}
do {
+ size_t before = io.received;
if (io.response.len) {
if (io.content_length && io.response.len + io.received > io.content_length) {
io.response.len = io.content_length - io.received;
if (progressbar) {
if (io.content_length) {
- pdots(50, '.', total, total+ret,
+ pdots(50, '.', before, io.received,
io.content_length);
} else {
putc('\r', stderr);
close(sockfd);
if (progressbar && io.status_code == 200) {
- if (total == io.content_length || io.content_length == 0) {
+ if (io.received == io.content_length || io.content_length == 0) {
fprintf(stderr, " done\n");
- } else if (io.content_length != total) {
+ } else if (io.content_length != io.received) {
fprintf(stderr, "failed (%zu bytes read)\n", total);
io.status_code = 531; /* non official code */
}