cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: CURLOPT_CONNECT_ONLY

From: Ramprakash Jelari thinakaran <jelari_at_gmail.com>
Date: Tue, 15 Apr 2008 15:23:02 +0530

Hi Michal,

Call back is this:

 size_t BURAWrite_Callback(void* data, size_t size, size_t nmemb, void*
input)

{

std::ostringstream *os= static_cast<std::ostringstream*>(input);

cout<<endl<<"Write_Callback Called "<<endl;

char *cstr=static_cast<char*>(data);

size_t len = size * nmemb;

if(!(os->write(cstr, len))) return CURLE_WRITE_ERROR;

return len;

}

ehandler is :

ehandler = curl_easy_init();

and one more question to add with?..
when we do curl_easy_perform(ehandler) where ehandler is set for
CURLOPT_CONNECT_ONLY, Will it send the http header information to the
server?..
because, i am adding some of my own header informations along with existing
one.

-- 
Regards,
Ramprakash Jelari
*"TeamWork is the fuel that allows commom people to attain uncommon results"
*
On 4/15/08, Michal Marek <mmarek_at_suse.cz> wrote:
>
> Ramprakash Jelari thinakaran wrote:
> > I have set  CURLOPT_CONNECT_ONLY.  and invoking  curl_easy_perform()
> >
> >
> > std::ostringstream httpResponse;
> > curl_easy_setopt(ehandler, CURLOPT_WRITEFUNCTION,
> BURAdataWrite_Callback);
> > curl_easy_setopt(ehandler, CURLOPT_WRITEDATA, &httpResponse);
>
> What is ehandler and BURAdataWrite_Callback? Typos or secret variables?
>
>
> > curl_easy_setopt(handler, CURLOPT_CONNECT_ONLY, 1);
> > ret = curl_easy_perform(handler);
> >
> >
> > *In this case, is it a valid operation to capture the reply from Server
> > through write callback?*
>
> CURLOPT_CONNECT_ONLY disables any data transfer in curl_easy_perform,
> your write callback won't be called at all.
>
> Michal
>
Received on 2008-04-15