mirror of
https://github.com/darlinghq/darling-libxml2.git
synced 2025-01-10 14:11:54 +00:00
change xmlReadFd() xmlCtxtReadFd() xmlReaderNewFd() xmlReaderForFd(),
* parser.c xmlreader.c: change xmlReadFd() xmlCtxtReadFd() xmlReaderNewFd() xmlReaderForFd(), change those to not close the file descriptor. Updated the comment, should close #129683 Daniel
This commit is contained in:
parent
2d2f155224
commit
4bc5f43064
@ -1,3 +1,9 @@
|
||||
Mon Dec 22 19:06:16 CET 2003 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* parser.c xmlreader.c: change xmlReadFd() xmlCtxtReadFd()
|
||||
xmlReaderNewFd() xmlReaderForFd(), change those to not close
|
||||
the file descriptor. Updated the comment, should close #129683
|
||||
|
||||
Mon Dec 22 00:34:09 CET 2003 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* xinclude.c: fixed a serious problem in XInclude #129021
|
||||
|
6
parser.c
6
parser.c
@ -12553,6 +12553,8 @@ xmlReadMemory(const char *buffer, int size, const char *URL, const char *encodin
|
||||
* @options: a combination of xmlParserOption
|
||||
*
|
||||
* parse an XML from a file descriptor and build a tree.
|
||||
* NOTE that the file descriptor will not be closed when the
|
||||
* reader is closed or reset.
|
||||
*
|
||||
* Returns the resulting document tree
|
||||
*/
|
||||
@ -12569,6 +12571,7 @@ xmlReadFd(int fd, const char *URL, const char *encoding, int options)
|
||||
input = xmlParserInputBufferCreateFd(fd, XML_CHAR_ENCODING_NONE);
|
||||
if (input == NULL)
|
||||
return (NULL);
|
||||
input->closecallback = NULL;
|
||||
ctxt = xmlNewParserCtxt();
|
||||
if (ctxt == NULL) {
|
||||
xmlFreeParserInputBuffer(input);
|
||||
@ -12747,6 +12750,8 @@ xmlCtxtReadMemory(xmlParserCtxtPtr ctxt, const char *buffer, int size,
|
||||
*
|
||||
* parse an XML from a file descriptor and build a tree.
|
||||
* This reuses the existing @ctxt parser context
|
||||
* NOTE that the file descriptor will not be closed when the
|
||||
* reader is closed or reset.
|
||||
*
|
||||
* Returns the resulting document tree
|
||||
*/
|
||||
@ -12768,6 +12773,7 @@ xmlCtxtReadFd(xmlParserCtxtPtr ctxt, int fd,
|
||||
input = xmlParserInputBufferCreateFd(fd, XML_CHAR_ENCODING_NONE);
|
||||
if (input == NULL)
|
||||
return (NULL);
|
||||
input->closecallback = NULL;
|
||||
stream = xmlNewIOInputStream(ctxt, input, XML_CHAR_ENCODING_NONE);
|
||||
if (stream == NULL) {
|
||||
xmlFreeParserInputBuffer(input);
|
||||
|
@ -4342,6 +4342,8 @@ xmlReaderForMemory(const char *buffer, int size, const char *URL,
|
||||
*
|
||||
* Create an xmltextReader for an XML from a file descriptor.
|
||||
* The parsing flags @options are a combination of xmlParserOption.
|
||||
* NOTE that the file descriptor will not be closed when the
|
||||
* reader is closed or reset.
|
||||
*
|
||||
* Returns the new reader or NULL in case of error.
|
||||
*/
|
||||
@ -4357,6 +4359,7 @@ xmlReaderForFd(int fd, const char *URL, const char *encoding, int options)
|
||||
input = xmlParserInputBufferCreateFd(fd, XML_CHAR_ENCODING_NONE);
|
||||
if (input == NULL)
|
||||
return (NULL);
|
||||
input->closecallback = NULL;
|
||||
reader = xmlNewTextReader(input, URL);
|
||||
if (reader == NULL) {
|
||||
xmlFreeParserInputBuffer(input);
|
||||
@ -4553,6 +4556,8 @@ xmlReaderNewMemory(xmlTextReaderPtr reader, const char *buffer, int size,
|
||||
* @options: a combination of xmlParserOption
|
||||
*
|
||||
* Setup an xmltextReader to parse an XML from a file descriptor.
|
||||
* NOTE that the file descriptor will not be closed when the
|
||||
* reader is closed or reset.
|
||||
* The parsing flags @options are a combination of xmlParserOption.
|
||||
* This reuses the existing @reader xmlTextReader.
|
||||
*
|
||||
@ -4572,6 +4577,7 @@ xmlReaderNewFd(xmlTextReaderPtr reader, int fd,
|
||||
input = xmlParserInputBufferCreateFd(fd, XML_CHAR_ENCODING_NONE);
|
||||
if (input == NULL)
|
||||
return (-1);
|
||||
input->closecallback = NULL;
|
||||
return (xmlTextReaderSetup(reader, input, URL, encoding, options));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user