[Webkit-unassigned] [Bug 18832] [curl] file upload does not work

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu May 1 13:32:59 PDT 2008


http://bugs.webkit.org/show_bug.cgi?id=18832





------- Comment #1 from arenevier at fdn.fr  2008-05-01 13:32 PDT -------
Hi,
I'm compiled gtk-webkit with curl backend on a debian unstable, and file upload
does not work.

In send a negative Content-Length header to the server. 
For example, "Content-Length: -5191020756686863821" (with a file of 369 bytes).
Then, I usually get a message error from the server.

I think that's because libcurl is build with large file support (making
sizeof(curl_off_t) equal to 8), while webkit is not (making sizeof(curl_off_t)
equal to 4).

So, in libcurl (lib/http.c): 

#if SIZEOF_CURL_OFF_T > 4
#define FORMAT_OFF_T "lld" 
#else                      
#define FORMAT_OFF_T "ld"
#endif

[...]

   result = add_bufferf(req_buffer,
                           "Content-Length: %" FORMAT_OFF_T "\r\n",
                           http->postsize);

outputs a negative value.



In  WebCore/platform/network/curl/ResourceHandleManager.cpp, if I use, in
function ResourceHandleManager::setupPOST:

curl_easy_setopt(d->m_handle, CURLOPT_POSTFIELDSIZE, size);

instead of 

 curl_easy_setopt(d->m_handle, CURLOPT_POSTFIELDSIZE_LARGE, size)

Content-Length header is correct, and file upload works.

I tried to add AC_SYS_LARGEFILE in configure.ac, but it seems to create
aconfig.h which is not sourced by
WebCore/platform/network/curl/ResourceHandleManager.cpp

For testing purpose, I have tried to put
#define _FILE_OFFSET_BITS 64 at the very top of
WebCore/platform/network/curl/ResourceHandleManager.cpp and it fixes the bug.


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list