--------------------- PatchSet 1480 Date: 2001/02/02 14:23:23 Author: rbcollins Branch: te_modules Tag: (none) Log: bugfix for TE with 0 length bodies Members: src/client_side.c:1.1.1.3.4.1.4.13.2.3->1.1.1.3.4.1.4.13.2.4 src/transfer-encoding.c:1.1.4.5->1.1.4.6 Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.1.1.3.4.1.4.13.2.3 retrieving revision 1.1.1.3.4.1.4.13.2.4 diff -u -r1.1.1.3.4.1.4.13.2.3 -r1.1.1.3.4.1.4.13.2.4 --- squid/src/client_side.c 15 Jan 2001 09:38:17 -0000 1.1.1.3.4.1.4.13.2.3 +++ squid/src/client_side.c 2 Feb 2001 14:23:23 -0000 1.1.1.3.4.1.4.13.2.4 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.1.1.3.4.1.4.13.2.3 2001/01/15 09:38:17 rbcollins Exp $ + * $Id: client_side.c,v 1.1.1.3.4.1.4.13.2.4 2001/02/02 14:23:23 rbcollins Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -2103,6 +2103,7 @@ (size == 0 && !(http->oldte_rv & TE_BUFFERING_OUTPUT))) { debug(33, 5) ("clientWriteComplete: FD %d transfer is DONE\n", fd); /* We're finished case */ + if (!http->flags.done_copying) { http->oldte_rv = free_te = perform_te (http->te_translations,NULL,0, &stuck_data, &stuckdatasize); if (stuckdatasize > 0) @@ -2122,6 +2123,11 @@ if (free_te & TE_BUFFER_ALLOCATED) xfree (stuck_data); + if (free_te & TE_CHUNK_A) /* signal from dochunk() that + data has been chunked */ + { + http->flags.done_copying = 1; + } return; } if (free_te & TE_CHUNK_A) /* signal from dochunk() that @@ -2129,6 +2135,7 @@ { http->flags.done_copying = 1; } + } if (httpReplyBodySize(http->request->method, entry->mem_obj->reply) < 0) { debug(33, 5) ("clientWriteComplete: closing, content_length < 0\n"); comm_close(fd); Index: squid/src/transfer-encoding.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/transfer-encoding.c,v retrieving revision 1.1.4.5 retrieving revision 1.1.4.6 diff -u -r1.1.4.5 -r1.1.4.6 --- squid/src/transfer-encoding.c 16 Jan 2001 10:25:29 -0000 1.1.4.5 +++ squid/src/transfer-encoding.c 2 Feb 2001 14:23:23 -0000 1.1.4.6 @@ -125,14 +125,18 @@ *d = (void *) 0x01; } else /* end signal */ +#if 0 if (*d) +#endif { strcpy (tb,"0\r\n\r\n"); created = 5; debug(82,8) ("created chunk of %d\n",ibufl); *d = NULL; - rv = TE_BUFFERING_OUTPUT; - } + rv = TE_CHUNK_A | TE_BUFFER_ALLOCATED; //TE_BUFFERING_OUTPUT; + +} +#if 0 else { /* allocate a buffer of length 128, and return it with length 0 */ @@ -140,7 +144,7 @@ *obufl = 0; return TE_CHUNK_A | TE_BUFFER_ALLOCATED; /* signal that dochunk() is complete */ } - +#endif *obuf = tb; *obufl = created;