| 728 while(rd < nbytes && (perform_io || (st->max_read - st->read) > 0)) { |
728 while(rd < nbytes && (perform_io || (st->max_read - st->read) > 0)) { |
| 729 // how many bytes are available in the current chunk |
729 // how many bytes are available in the current chunk |
| 730 size_t chunk_available = st->max_read - st->read; |
730 size_t chunk_available = st->max_read - st->read; |
| 731 if(chunk_available > 0) { |
731 if(chunk_available > 0) { |
| 732 ssize_t r = http_read_buffered(st, rbuf, rbuflen, TRUE, &perform_io); |
732 ssize_t r = http_read_buffered(st, rbuf, rbuflen, TRUE, &perform_io); |
| 733 if(r == 0) { |
733 if(r <= 0) { |
| |
734 if(rd == 0) { |
| |
735 rd = r; |
| |
736 } |
| 734 break; |
737 break; |
| 735 } |
738 } |
| 736 rd += r; |
739 rd += r; |
| 737 st->read_total += r; |
740 st->read_total += r; |
| 738 rbuf += r; |
741 rbuf += r; |