Improved FTP InternetReadFile patch

Krzysztof Foltman kfoltman at portal.onet.pl
Tue Sep 7 15:28:06 CDT 2004


Hi All,

This patch replaces my previous internet.c patch related to 
InternetReadFile returning incomplete buffers.

I made use of Uwe's comment about recv() giving full buffers when 
MSG_WAITALL flag is set. It has dramatically reduced patch size and 
improved clarity.

Chris
-------------- next part --------------
Index: dlls/wininet/internet.c
===================================================================
RCS file: /home/wine/wine/dlls/wininet/internet.c,v
retrieving revision 1.95
diff -u -r1.95 internet.c
--- dlls/wininet/internet.c	19 Aug 2004 19:02:17 -0000	1.95
+++ dlls/wininet/internet.c	7 Sep 2004 20:23:44 -0000
@@ -1646,7 +1646,7 @@
             nSocket = ((LPWININETFILE)lpwh)->nDataSocket;
             if (nSocket != -1)
             {
-                int res = recv(nSocket, lpBuffer, dwNumOfBytesToRead, 0);
+                int res = recv(nSocket, lpBuffer, dwNumOfBytesToRead, MSG_WAITALL);
                 retval = (res >= 0);
                 *dwNumOfBytesRead = retval ? res : 0;
             }


More information about the wine-patches mailing list