curl-library
[Fwd: exception in ConnectPlease]
Date: Tue, 23 Oct 2001 06:12:02 -0400
attached mail follows:
On Mon, 22 Oct 2001, T. Bharath wrote:
> I was trying out with curl7.9.1pre4.When i was trying to download a page
> an exception was thrown at ConnectPlease in
> memcpy((char *)&(conn->serv_addr.sin_addr),
> (struct in_addr *)addr, sizeof(struct in_addr));
> because addr was null
Uh. That's not good.
> My network connection went down at that time.Iam not sure if that may
> have triggered it. I was reusing the handle for multiple downloads Iam
> still investigating that,I thought may be you could throw some light on
> it
Hm, well that particular code should not run if a connection is being
re-used, a new connection is only mad if a previous connection couldn't be
used.
'addr' could only be NULL there if Curl_connecthost() returns CURLE_OK and
failed to set the addr parameter to a good pointer.
I can only see this being possible to happen if the for()-loop on line 481 in
my version never runs a single lap, because the remotehost->h_addr_list[0] is
NULL and then it all runs through with no errors and *addr set to that
pointer in the end.
Do you think that could be what happened? We should add some kind of check
that such a scenario doesn't happen again.
-- Daniel Stenberg - http://daniel.haxx.se - +46-705-44 31 77 ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`olReceived on 2001-10-23