cURL / Mailing Lists / curl-library / Single Mail

curl-library

HTTP Posts and 100-continue

From: <disqspam_at_oynasana.com>
Date: Tue, 2 Mar 2004 15:37:12 +0200

Hi,

  Some of my users are getting HTTP 100 error. I can't reproduce the
  problem on my side, I'm guessing it's related to the data length though.

  Versions, compilers and code snippet:

  libcurl: 7.10.7
  compiler: vc++ 6

  snippet: (data length info commented inside the code. http server info follows)

long int retcode=0;
CURL *curl = curl_easy_init();
CURLcode res;
if(curl)
{
struct curl_httppost *post=NULL;
struct curl_httppost *last=NULL;
curl_formadd(&post, &last, CURLFORM_COPYNAME, "un",CURLFORM_COPYCONTENTS, var1, CURLFORM_END);
curl_formadd(&post, &last, CURLFORM_COPYNAME, "p",CURLFORM_COPYCONTENTS, var2, CURLFORM_END);
curl_formadd(&post, &last, CURLFORM_COPYNAME, "s",CURLFORM_COPYCONTENTS, var3 CURLFORM_END);
curl_formadd(&post, &last, CURLFORM_COPYNAME, "in",CURLFORM_COPYCONTENTS, var4, CURLFORM_END);

// post data length info:
// var1 is 4-16 chars
// var2 is 4-16 chars
// var3 is 15-20 chars
// var4 is greater than 800 chars. might be up to 2k iirc.

curl_easy_setopt(curl, CURLOPT_HTTPPOST, post);
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_USERAGENT, "bla bla");
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curlDataReceived);
curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, curlProgress);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 5);
res = curl_easy_perform(curl);
curl_easy_getinfo(curl, CURLINFO_HTTP_CODE, &retcode);
curl_easy_cleanup(curl);
curl_formfree(post);
}

now. on some people, retcode is 100, res is 0. but no data received.
it's supposed to receive an "OK" or some error code with a little
descriptive text. so, return value from the http server is between 2
and 32 chars.

https server's an apache 1.3.28 with php 4.3.3, running on slackware linux.

what might be causing the problem?

-- 
Thanks
Kemal Hadimli
Received on 2004-03-02