Commit ddffd2a7 authored by Daniel Veillard's avatar Daniel Veillard
Browse files

closed #73430, don't read from an input source which indicated an

* xmlIO.c: closed #73430, don't read from an input source
  which indicated an end-of-file or an error.
Daniel
parent 8d24cc18
Tue Mar 5 21:27:03 CET 2002 Daniel Veillard <daniel@veillard.com>
* xmlIO.c: closed #73430, don't read from an input source
which indicated an end-of-file or an error.
Tue Mar 5 16:33:42 CET 2002 Daniel Veillard <daniel@veillard.com>
* parser.c: make sure SAX endDocument is always called as
......
......@@ -2080,6 +2080,19 @@ xmlParserInputBufferPush(xmlParserInputBufferPtr in,
return(nbchars);
}
/**
* endOfInput:
*
* When reading from an Input channel indicated end of file or error
* don't reread from it again.
*/
static int
endOfInput (void * context ATTRIBUTE_UNUSED,
char * buffer ATTRIBUTE_UNUSED,
int len ATTRIBUTE_UNUSED) {
return(0);
}
/**
* xmlParserInputBufferGrow:
* @in: a buffered parser input
......@@ -2125,6 +2138,8 @@ xmlParserInputBufferGrow(xmlParserInputBufferPtr in, int len) {
*/
if (in->readcallback != NULL) {
res = in->readcallback(in->context, &buffer[0], len);
if (res <= 0)
in->readcallback = endOfInput;
} else {
xmlGenericError(xmlGenericErrorContext,
"xmlParserInputBufferGrow : no input !\n");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment