small enhancement to last fix, pointed out by Alex Cornejo
* nanohttp.c: small enhancement to last fix, pointed out
by Alex Cornejo
svn path=/trunk/; revision=3617
diff --git a/nanohttp.c b/nanohttp.c
index 51bb898..2406e7e 100644
--- a/nanohttp.c
+++ b/nanohttp.c
@@ -1203,8 +1203,10 @@
ctxt->strm->next_out = dest;
ctxt->strm->avail_out = len;
+ ctxt->strm->avail_in = ctxt->inptr - ctxt->inrptr;
- while (ctxt->strm->avail_out > 0 && xmlNanoHTTPRecv(ctxt) > 0) {
+ while (ctxt->strm->avail_out > 0 &&
+ (ctxt->strm->avail_in > 0 || xmlNanoHTTPRecv(ctxt) > 0)) {
orig_avail_in = ctxt->strm->avail_in =
ctxt->inptr - ctxt->inrptr - bytes_read;
ctxt->strm->next_in = BAD_CAST (ctxt->inrptr + bytes_read);
@@ -1216,7 +1218,6 @@
}
ctxt->inrptr += bytes_read;
- ctxt->strm->avail_in = ctxt->inptr - ctxt->inrptr;
return(len - ctxt->strm->avail_out);
}
#endif