We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reposted bug report from the mailing list by cjmsoregan.
Reproducing example:
#include <curl/curl.h> char g_Data[40 * 1024]; // POST 40KB int sockopt_callback(void *clientp, curl_socket_t curlfd, curlsocktype purpose) { int sndbufsize = 4 * 1024; // 4KB send buffer setsockopt(curlfd, SOL_SOCKET, SO_SNDBUF, (const char *)&sndbufsize, sizeof(sndbufsize)); return CURL_SOCKOPT_OK; } int main(int argc, char *argv[]) { curl_slist* pHeaderList = NULL; CURL* pCurl = curl_easy_init(); curl_easy_setopt(pCurl, CURLOPT_SOCKOPTFUNCTION, sockopt_callback); curl_easy_setopt(pCurl, CURLOPT_CUSTOMREQUEST, "POST"); curl_easy_setopt(pCurl, CURLOPT_URL, "http://example.com"); curl_easy_setopt(pCurl, CURLOPT_POSTFIELDS, g_Data); curl_easy_setopt(pCurl, CURLOPT_POSTFIELDSIZE, sizeof (g_Data)); // Remove "Expect: 100-continue" pHeaderList = curl_slist_append(pHeaderList, "Expect:"); curl_easy_setopt(pCurl, CURLOPT_HTTPHEADER, pHeaderList); CURLcode code = curl_easy_perform(pCurl); if (code == CURLE_OK) { double uploadSize = 0.0; curl_easy_getinfo(pCurl, CURLINFO_SIZE_UPLOAD, &uploadSize); printf("uploadSize = %f\n", uploadSize); if (static_cast<size_t>(uploadSize) == sizeof (g_Data)) { printf("!!!!!!!!!! PASS\n"); } else { printf("!!!!!!!!!! FAIL\n"); } } else { printf("curl_easy_perform() failed. e = %d\n", code); } curl_slist_free_all(pHeaderList); curl_easy_cleanup(pCurl); return 0; }
Suggested patch:
// http.c ~L2879 if(http->writebytecount >= postsize) { /* already sent the entire request body, mark the "upload" as complete */ infof(data, "upload completely sent off: %" CURL_FORMAT_CURL_OFF_T " out of %" CURL_FORMAT_CURL_OFF_T " bytes\n", http->writebytecount, postsize); data->req.upload_done = TRUE; data->req.keepon &= ~KEEP_SEND; /* we're done writing */ data->req.exp100 = EXP100_SEND_DATA; /* already sent */ Curl_expire_done(data, EXPIRE_100_TIMEOUT); } + else { + data->req.writebytecount = http->writebytecount; + }
The text was updated successfully, but these errors were encountered:
CURLINFO_SIZE_UPLOAD: fix missing counter update
b573f7e
Reported-by: cjmsoregan Fixes #2847
2a278fd
8af2227
Adds test 1522 for verification. Reported-by: cjmsoregan Fixes curl#2847 Closes curl#2864
f72a7e0
bagder
No branches or pull requests
I did this
Reposted bug report from the mailing list by cjmsoregan.
Reproducing example:
Suggested patch:
The text was updated successfully, but these errors were encountered: