fixed problem on gzip streams (bug #438045) fixed minor spot of redundant

* nanohttp.c: fixed problem on gzip streams (bug #438045)
* xpath.c: fixed minor spot of redundant code - no logic change.

svn path=/trunk/; revision=3616
diff --git a/ChangeLog b/ChangeLog
index 3809d2a..8a9e85e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue May 15 12:38:38 PDT 2007 William Brack <wbrack@mmm.com.hk>
+
+	* nanohttp.c: fixed problem on gzip streams (bug #438045)
+	* xpath.c: fixed minor spot of redundant code - no logic change.
+
 Fri May 11 22:45:18 HKT 2007 William Brack <wbrack@mmm.com.hk>
 
 	* xpath.c: enhanced the coding for xmlXPathCastNumberToString
diff --git a/nanohttp.c b/nanohttp.c
index 26b5d7e..51bb898 100644
--- a/nanohttp.c
+++ b/nanohttp.c
@@ -1204,17 +1204,19 @@
         ctxt->strm->next_out = dest;
         ctxt->strm->avail_out = len;
 
-        do {
-            orig_avail_in = ctxt->strm->avail_in = ctxt->inptr - ctxt->inrptr - bytes_read;
+        while (ctxt->strm->avail_out > 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);
 
             z_ret = inflate(ctxt->strm, Z_NO_FLUSH);
             bytes_read += orig_avail_in - ctxt->strm->avail_in;
 
             if (z_ret != Z_OK) break;
-        } while (ctxt->strm->avail_out > 0 && xmlNanoHTTPRecv(ctxt) > 0);
+	}
 
         ctxt->inrptr += bytes_read;
+	ctxt->strm->avail_in = ctxt->inptr - ctxt->inrptr;
         return(len - ctxt->strm->avail_out);
     }
 #endif
diff --git a/xpath.c b/xpath.c
index 20ab273..fd77a40 100644
--- a/xpath.c
+++ b/xpath.c
@@ -14688,8 +14688,7 @@
 	do {
 	    tmp = valuePop(pctxt);
 	    if (tmp != NULL) {
-		if (tmp != NULL)
-		    stack++; 
+		stack++; 
 		xmlXPathReleaseObject(ctxt, tmp);
 	    }
 	} while (tmp != NULL);