cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: TLS security in Curl

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 5 Jan 2011 16:36:11 +0100 (CET)

On Wed, 5 Jan 2011, amit paliwal wrote:

I assume you're still on your quest to work with those server-sent events?

> The thing is, before using curl_easy_perform() to send HTTP GET and getting
> HTTP response, I need to block on some message from Server.

Yes, but libcurl already does that by itself. When you send the proper
requeste to the server, the server will simply not respond at once and libcurl
will sit waiting for it. That's the entire concept of SSE and if the server
doesn't do that then you didn't send the correct request or the server is
broken.

> But I think there is no provision to get block before sending HTTP GET by
> curl_easy_perform()

If you really want a block before GET you can use sleep() before you invoke
curl_easy_perform...

> 1) use typical OS calls, for e.g. select() followed by recv() to first ait
> and then use curl_easy_perform().

No you can't. curl_easy_perform() will set up its own connection/socket and
not use the one you used with select() or recv().

> 2) use CONNECT_ONLY and use curl_easy_send() and curl_easy_recv() to
> implement it in the way I need.

Yes, but if the server doesn't wait like I mentioned above it doesn't matter
if libcurl returns immediately or if your code does it, the error would still
be the same: the one I mentioned above.

> But I thought Curl can still handle TLS authentication while sending and
> receiving from network, even if i use curl_easy_send() and curl_easy_recv().

It does. But the moment you curl_easy_send() or curl_easy_recv() you've
abandoned all other protocol support libcurl can offer and you are entirely on
your own. IMHO, doing that with a plain HTTP based protocol is unwise.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-01-05