[xml] xmlNanoHTTPMethod closing stdin on connection error?

Date view Thread view Subject view Author view

From: Harry Blundell (harry@halcyoninc.com)
Date: Wed Jan 10 2001 - 09:37:41 EST


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?

Thanks,

Harry
----------------------------------------------------------------------
Harry Blundell Principal / Senior Software Designer
Halcyon Monitoring Solutions Inc. URL: http://www.HalcyonInc.com
2300 Yonge St., Suite 1801, Box 2419, Toronto ON M4P 1E4, Canada.
PHONE: 416-932-4631 FAX: 416-932-4711 EMAIL: harry@HalcyonInc.com

----
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 - 09:44:19 EST