[CLT2012]
[reactos.git] / dll / win32 / winhttp / winhttp_ros.diff
1 --- wine-1.3.4/dlls/winhttp/net.c 2010-10-01 14:46:44.000000000 -0400
2 +++ dll/win32/winhttp/net.c 2010-10-09 17:04:11.000000000 -0400
3 @@ -158,6 +158,7 @@
4 #endif
5
6 /* translate a unix error code into a winsock error code */
7 +#if 0
8 static int sock_get_error( int err )
9 {
10 #if !defined(__MINGW32__) && !defined (_MSC_VER)
11 @@ -223,6 +224,9 @@
12 #endif
13 return err;
14 }
15 +#else
16 +#define sock_get_error(x) WSAGetLastError()
17 +#endif
18
19 #ifdef SONAME_LIBSSL
20 static PCCERT_CONTEXT X509_to_cert_context(X509 *cert)
21 @@ -632,11 +636,16 @@
22 res = sock_get_error( errno );
23 if (res == WSAEWOULDBLOCK || res == WSAEINPROGRESS)
24 {
25 - struct pollfd pfd;
26 + fd_set outfd;
27 + struct timeval tv;
28 +
29 + FD_ZERO(&outfd);
30 + FD_SET(conn->socket, &outfd);
31
32 - pfd.fd = conn->socket;
33 - pfd.events = POLLOUT;
34 - if (poll( &pfd, 1, timeout ) > 0)
35 + tv.tv_sec = 0;
36 + tv.tv_usec = timeout * 1000;
37 +
38 + if (select( 0, NULL, &outfd, NULL, &tv ) > 0)
39 ret = TRUE;
40 else
41 res = sock_get_error( errno );
42 @@ -832,7 +841,7 @@
43
44 BOOL netconn_get_next_line( netconn_t *conn, char *buffer, DWORD *buflen )
45 {
46 - struct pollfd pfd;
47 + fd_set infd;
48 BOOL ret = FALSE;
49 DWORD recvd = 0;
50
51 @@ -867,20 +876,22 @@
52 return FALSE;
53 #endif
54 }
55 -
56 - pfd.fd = conn->socket;
57 - pfd.events = POLLIN;
58 +
59 + FD_ZERO(&infd);
60 + FD_SET(conn->socket, &infd);
61 +
62 while (recvd < *buflen)
63 {
64 - int timeout, res;
65 - struct timeval tv;
66 + int res;
67 + struct timeval tv, *ptv;
68 socklen_t len = sizeof(tv);
69
70 if ((res = getsockopt( conn->socket, SOL_SOCKET, SO_RCVTIMEO, (void*)&tv, &len ) != -1))
71 - timeout = tv.tv_sec * 1000 + tv.tv_usec / 1000;
72 + ptv = &tv;
73 else
74 - timeout = -1;
75 - if (poll( &pfd, 1, timeout ) > 0)
76 + ptv = NULL;
77 +
78 + if (select( 0, &infd, NULL, NULL, ptv ) > 0)
79 {
80 if ((res = recv( conn->socket, &buffer[recvd], 1, 0 )) <= 0)
81 {
82 --- wine-1.3.4/dlls/winhttp/session.c 2010-10-01 14:46:44.000000000 -0400
83 +++ dll/win32/winhttp/session.c 2010-10-09 17:04:11.000000000 -0400
84 @@ -38,6 +38,9 @@
85 #define DEFAULT_SEND_TIMEOUT 30000
86 #define DEFAULT_RECEIVE_TIMEOUT 30000
87
88 +/* FIXME */
89 +#define CP_UNIXCP CP_ACP
90 +
91 void set_last_error( DWORD error )
92 {
93 /* FIXME */
94 --- wine-1.3.4/dlls/winhttp/request.c 2010-10-01 14:46:44.000000000 -0400
95 +++ dll/win32/winhttp/request.c 2010-10-09 17:04:11.000000000 -0400
96 @@ -34,6 +34,8 @@
97
98 #include "winhttp_private.h"
99
100 +#include "inet_ntop.c"
101 +
102 WINE_DEFAULT_DEBUG_CHANNEL(winhttp);
103
104 static const WCHAR attr_accept[] = {'A','c','c','e','p','t',0};