| 744 // fill st->chunk_buf |
744 // fill st->chunk_buf |
| 745 ssize_t r = http_read_buffered(st, &st->chunk_buf[st->chunk_buf_pos], chunkbuf_avail, FALSE, &perform_io); |
745 ssize_t r = http_read_buffered(st, &st->chunk_buf[st->chunk_buf_pos], chunkbuf_avail, FALSE, &perform_io); |
| 746 if(r == 0) { |
746 if(r == 0) { |
| 747 break; |
747 break; |
| 748 } |
748 } |
| |
749 if(r < 0) { |
| |
750 if(rd == 0) { |
| |
751 rd = r; |
| |
752 } |
| |
753 break; |
| |
754 } |
| 749 int chunkbuf_len = st->chunk_buf_pos + r; |
755 int chunkbuf_len = st->chunk_buf_pos + r; |
| 750 int64_t chunklen; |
756 int64_t chunklen; |
| 751 int ret = http_stream_parse_chunk_header(st->chunk_buf, chunkbuf_len, st->read_total > 0 ? FALSE : TRUE, &chunklen); |
757 int ret = http_stream_parse_chunk_header(st->chunk_buf, chunkbuf_len, st->read_total > 0 ? FALSE : TRUE, &chunklen); |
| 752 if(ret == 0) { |
758 if(ret == 0) { |
| 753 // incomplete chunk header |
759 // incomplete chunk header |