[PATCH] (Updated) setup.exe: Stop NetIO_HTTP from treating entire stream as a header

Gary R. Van Sickle g.r.vansickle@worldnet.att.net
Sat Oct 27 03:01:00 GMT 2001


Ok, with a bit of help from Mr. Tsekov et al, this ought to do it:


2001-11-26  Gary R. Van Sickle  <g.r.vansickle@worldnet.att.net>

	* nio-http.cc (NetIO_HTTP::NetIO_HTTP): Stop header parsing when
	SimpleSocket::gets() returns a zero-length string, so that we
	don't end up eating the entire stream thinking it's all header info.


Index: nio-http.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/nio-http.cc,v
retrieving revision 2.7
diff -p -u -b -r2.7 nio-http.cc
--- nio-http.cc	2001/11/13 01:49:32	2.7
+++ nio-http.cc	2001/11/28 07:24:49
@@ -180,7 +180,9 @@ retry_get:
       s = 0;
       return;
     }
-  while ((l = s->gets ()) != 0)
+    
+  // Eat the header, picking out the Content-Length in the process
+  while (((l = s->gets ()) != NULL) && (*l != '\0'))
     {
       if (_strnicmp (l, "Content-Length:", 15) == 0)
 	sscanf (l, "%*s %d", &file_size);

-- 
Gary R. Van Sickle
Brewer.  Patriot. 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nio-http.cc-changelog
Type: application/octet-stream
Size: 265 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20011027/35bdbb78/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nio-http.cc-patch
Type: application/octet-stream
Size: 597 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20011027/35bdbb78/attachment-0001.obj>


More information about the Cygwin-patches mailing list