Hi Raghu,

 

                I added the statement as you given.  Here also the behavior
is same except some debug information is added in addition.

The same function is working fine when I used "http://www.google.com";
instead of "http://127.0.0.1:8888";

 

See the output of this program.

 

before perform

* About to connect() to 127.0.0.1 port 8888 (#0)

*   Trying 127.0.0.1... * connected

* Connected to 127.0.0.1 (127.0.0.1) port 8888 (#0)

> POST / HTTP/1.1

Host: 127.0.0.1:8888

Accept: */*

Content-Type: text/html

Content-Length: 29

 

POST / HTTP/1.1

Host: 127.0.0.1:8888

Accept: */*

Content-Type: text/html

Content-Length: 29

 

name=RAJANI

project=curl

 

Thanks,

Rajanikanth

 

From: [email protected]
[mailto:[email protected]] On Behalf Of Raghavendra Prasad
Bilamkar
Sent: Tuesday, July 20, 2010 6:10 PM
To: libcurl development
Subject: RE: doubt on curl_easy_perform

 

hi Rajanikanth,

 

Add this line to get the verbose information on the connection, this will
help you to analyze it further.

 

curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);

 

Regards

Raghu

 

 

From: [email protected]
[mailto:[email protected]] On Behalf Of Rajanikanth
Sent: 2010 Jul 20 5:53 PM
To: [email protected]
Subject: doubt on curl_easy_perform

 

Hi,

            Is there any forum exists, to get clarifications on the cURL
function calls?

 

            Actually when I am using the function call 'curl_easy_perform',
at run time it is getting hanged without any response. I concluded it
because I am not getting any return value which I am printing after
execution of the function.

 

                Following is my sample program. (NOTE: There is one other
executable listening a socket at '127.0.0.1:8888' and it just returns what
it received)

 

#include <stdio.h>

#include <curl/curl.h>

int main(void)

{

       CURL *curl;

       CURLcode res;

       struct curl_slist *headerlist=NULL;

       curl = curl_easy_init();

       if(curl) 

       {             

              curl_easy_setopt(curl, CURLOPT_URL, "http://127.0.0.1:8888";); 

              

              headerlist = curl_slist_append(headerlist, "Content-Type:
text/html");

 

              curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist);

              /* Now specify the POST data */ 

              curl_easy_setopt(curl, CURLOPT_POSTFIELDS,
"name=RAJANI\r\nproject=curl\r\n\r\n");

 

              printf("B4 perform\n");

              res = curl_easy_perform(curl);

              if (res == 0)

                     printf("After perform\n");

              else

                     printf("Perform returns = %d\n", res);

 

              curl_easy_cleanup(curl);

       }

return 0;

}

 

Thanks & Regards,

Rajanikanth N.V

+91   89789 33889

 

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to