curl-library
Re: HTTPS POST closing connection
Date: Wed, 27 Mar 2002 16:20:01 +0100 (MET)
On Wed, 27 Mar 2002, T. Bharath wrote:
> Interestingly yesterday i found a bug where libcurl keeps trying to send
> data on a closed connection when i post a request through proxy (This
> happens only through a proxy) and when i reuse the same connection I use
> curl 7. 9.1.
[...]
> This is a quick hand made patch
>
> File: <File: > url.c Line :1014
> static bool
> ConnectionExists(struct SessionHandle *data,
> struct connectdata *needle,
> struct connectdata **usethis)
> {
> ...
>
> else { /* The requested needle connection is using a proxy,
> is the checked one using the same? */
> if(check->bits.httpproxy &&
> strequal(needle->proxyhost, check->proxyhost) &&
> needle->port == check->port) {
> + bool dead = SocketIsDead(check->firstsocket);
> + if(dead) {
> + infof(data, "Connection %d through proxy seems to be dead!\n",
> i);
> + Curl_disconnect(check); /* disconnect resources */
> + data->state.connects[i]=NULL; /* nothing here */
> + continue; /* try another one now */
> + }
This patch doesn't apply on recent libcurls, as this particular check has
been modified since. It may still be a valid fix though.
I'm trying to understand why the SocketIsDead() isn't made for proxy
connections, but I can't but think otherwise than that this is a plain
mistake.
I adjusted it to 7.9.[56]-conditions and my version of the same is attached
to my mail here.
> File: http.c Line :937
(this patch only added a more specific error text)
-- Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
- TEXT/PLAIN attachment: closed-proxy.patch