Re: [xml] xmlNanoHTTPMethod closing stdin on connection error?

Date view Thread view Subject view Author view

From: Daniel Veillard (Daniel.Veillard@imag.fr)
Date: Wed Jan 10 2001 - 09:45:41 EST


On Wed, Jan 10, 2001 at 09:37:41AM -0500, Harry Blundell wrote:
>
> Hi,
>
> I think there's a problem with xmlNanoHTTPMethod: in the case that it is
> unable to connect, it closes stdin.
>
> It calls xmlNanoHTTPNewCtxt to get ctxt, with the memory (including
> ctxt->fd) all zeroed.
>
> It then calls xmlNanoHTTPConnectHost to make the connection - if this
> function is unable to connect, it returns -1, which then triggers a call
> to xmlNanoHTTPFreeCtxt, which closes ctxt->fd if it is >=0.
>
> It seems to me that we could avoid this by initializing ret->fd
> (ctxt->fd) to -1 in xmlNanoHTTPNewCtxt.
>
> Or am I missing something?

  No, this sounds perfectly right, this is broken and is the right
fix obviously ! Good catch, i hope it didn't took too much time to find
this <grin/>.
  Commited in CVS,

    thanks again,

Daniel

-- 
Daniel Veillard      | Red Hat Network http://redhat.com/products/network/
daniel@veillard.com  | libxml Gnome XML toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
----
Message from the list xml@rpmfind.net
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rpmfind.net


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Jan 10 2001 - 10:44:13 EST