Ticket #6: fix.patch
File fix.patch, 2.2 KB (added by , 13 years ago) |
---|
-
ntripcastertypes.h
228 228 char buf[20]; // to store hex length. ajd 229 229 int off; // store offset in buf. 230 230 int left; 231 int finish; 231 232 } http_chunk_t; 232 233 233 234 typedef struct statistics_St -
source.c
647 647 xa_debug (5, "add_chunk: hex [%s], read=%d", con->http_chunk->buf, len); 648 648 649 649 if (len > (20 - con->http_chunk->off)) { // a whole line could be read. ajd 650 con->http_chunk->left = strtol(con->http_chunk->buf, (char **)NULL, 16); 651 con->http_chunk->off = 0; 652 653 xa_debug (4, "add_chunk: http chunk left=%d", con->http_chunk->left); 654 650 if(con->http_chunk->finish) 651 { 652 xa_debug (4, "read trailing [%s]", con->http_chunk->buf); 653 con->http_chunk->finish = 0; 654 continue; 655 } 656 else 657 { 658 con->http_chunk->left = strtol(con->http_chunk->buf, (char **)NULL, 16); 659 con->http_chunk->off = 0; 660 con->http_chunk->finish = 1; 661 xa_debug (4, "add_chunk: http chunk left=%d", con->http_chunk->left); 662 } 655 663 } else if (len > 0) { 656 664 con->http_chunk->off += len; 657 665 len = -1; … … 761 769 con->food.source->chunk[con->food.source->cid].len = read_bytes; 762 770 con->food.source->chunk[con->food.source->cid].clients_left = con->food.source->num_clients; 763 771 con->food.source->cid = (con->food.source->cid + 1) % CHUNKLEN; 764 765 //printf("chunk %d of size %d added!\r\n", con->food.source->cid, read_bytes); 766 767 /* rtsp. ajd */ 772 768 773 if (con->trans_encoding == chunked_e) { 769 774 con->http_chunk->left = con->http_chunk->left - read_bytes; 770 if (con->http_chunk->left <= 0) {771 len = sock_read_line(con->sock, con->http_chunk->buf, 20); // read trailing /n. ajd772 773 xa_debug (4, "read trailing [%s]", con->http_chunk->buf);774 775 con->http_chunk->off = 0;776 }777 775 xa_debug (4, "http_chunk left now=%d ", con->http_chunk->left ); 778 776 } 779 777 }