Re: Re: Working with curl connections as with sockets.
Date: Tue, 29 Apr 2008 11:58:23 +0400
* Daniel Stenberg <daniel_at_haxx.se> [Tue, 29 Apr 2008 00:06:33 +0200
> On Mon, 28 Apr 2008, Tetetest wrote:
> > Currently, if you use this option, curl_easy_perform() returns
> > immediately after it connects to the proxy. It leaves you with
> > the socket that is basically unusable: you must perform the
> > proxy negotiation yourself. So, CURLOPT_CONNECT_ONLY
> > should connect you THROUGH the proxy, and not TO the proxy.
> Are you *sure* this is what happens? The whole purpose and idea when
> this option was added was exactly this "THROUGH the proxy" you
> mention and I have in fact used it like that myself in the past.
Errrrm... hmmmm... No, I am not sure anymore. :)
I have done another series of experiments, and now proxy connection
works just fine (both for HTTP tunnel and for SOCKS5). Must have been
the problem with my proxies, not with libcurl. Sorry.
The only concern is that curl_easy_perform() returns an error (Empty
reply from server) when used with CURLOPT_CONNECT_ONLY. So there is no
way to tell failed connections from successful ones.
> (TFTP is udp so that's hard to do
> over a HTTP CONNECT reqest!)
Oops. :) I didn't realize that.
> But you're not talking about using any of these protocols, you want
> and send, so why is this a concern now?
The concern was simple: if I modify the code for HTTP protocol, it will
still be possible to use other protocols with CURLOPT_CONNECT_ONLY
option, but the result will be undefined. But anyway, there is no need
to modify the protocols code, so nothing to concern about.
I have attached the patch that adds curl_easy_send() and
curl_easy_recv() functions to easy interface.
- application/octet-stream attachment: sendrecv.diff