curl-library
Re: libcurl 7.21.1 assertion in transfer.c:read_rewind(struct connectdata *conn, size_t thismuch)
Date: Mon, 23 Aug 2010 17:49:42 -0400
On Mon, 23 Aug 2010, Daniel Stenberg wrote:
>> I am seeing an assertion which appears to be a case where a chunked
>> response is processed and a rewind is attempted, but a master_buffer
>> has not been allocated. Has anyone else observed this behavior?
> I've not seen this before. Can you try to work on making a recipe for us to repeat this? Are you using pipelining?
Using the multi interface, pipeling is disabled. My home-grown server is sending a chunk-encoded response to a GET. If I do enable pipelining, then the assertion is no longer seen.
I have worked around the problem with the following patch:
--- curl-7.21.1.orig/lib/transfer.c
+++ curl-7.21.1/lib/transfer.c
@@ -594,9 +594,15 @@
dataleft = conn->chunk.dataleft;
if(dataleft != 0) {
- infof(conn->data, "Leftovers after chunking. "
- " Rewinding %zu bytes\n",dataleft);
- read_rewind(conn, dataleft);
+ if(conn->data->multi && Curl_multi_canPipeline(conn->data->multi)) {
+ infof(conn->data, "Leftovers after chunking. "
+ " Rewinding %zu bytes\n",dataleft);
+ read_rewind(conn, dataleft);
+ }
+ else {
+ infof(conn->data, "Leftovers after chunking in a non pipelined read. "
+ " Leaving %zu bytes\n",dataleft);
+ }
}
}
/* If it returned OK, we just keep going */
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-08-23