Re: [PATCH 1/1] Improve progress display in kB range.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



|> Therefore, in practice — and as I have witnessed several thousand times
|> without ever having seen a contrary example — display_throughput() is
|> called *durring* a download only when total & 0xFFF == 0xFFF.

Another possibility is an off-by-one error.  The relevant part of fill()
looks like:

,----< excerpt from index-pack.c:fill() >
|   do {
|     ssize_t ret = xread(input_fd, input_buffer + input_len,
|                         sizeof(input_buffer) - input_len);
|     if (ret <= 0) {
|       if (!ret)
|         die("early EOF");
|       die("read error on input: %s", strerror(errno));
|     }
|     input_len += ret;
|     if (from_stdin)
|       display_throughput(progress, consumed_bytes + input_len);
|   } while (input_len < min);
|   return input_buffer;
| }
`----

if *(input_buffer + ret) is the last read octet rather than the next
empty octet, that would also explain what I see.

Perhaps that call to display_throughput() should have an extra +1?

-JimC
-- 
James Cloos <cloos@xxxxxxxxxxx>         OpenPGP: 1024D/ED7DAEA6
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]