Hi,

If the size of the post data isn't yet known when starting the HTTP POST 
request (i.e. when using chunked transfer encoding), the variable postsize 
is 0 at line 1480 (in 7.19.7) in lib/http.c. With the current if statement 
at that line, no Expect: 100-continue header is emitted under that 
condition, even if the post data can be potentially huge.

The attached patch is a sample of how this could be fixed, but I'm not 
totally sure if this is the right approach. Would it perhaps be better to 
make a distinction between actual size 0 and size unknown earlier in the 
function?

// Martin
--- curl-7.19.7-orig/lib/http.c	2009-10-31 00:24:48.000000000 +0200
+++ curl-7.19.7/lib/http.c	2009-11-30 16:30:44.000000000 +0200
@@ -2837,7 +2844,7 @@
        the somewhat bigger ones we allow the app to disable it. Just make
        sure that the expect100header is always set to the preferred value
        here. */
-    if(postsize > TINY_INITIAL_POST_SIZE) {
+    if(postsize > TINY_INITIAL_POST_SIZE || postsize == 0) {
       result = expect100(data, conn, req_buffer);
       if(result)
         return result;
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to