reactos/dll/win32/winhttp/winhttp_ros.diff
Sylvain Petreolle 1fb94b1cb5 [CMAKE]
sync with trunk (r49230)

svn path=/branches/cmake-bringup/; revision=49246
2010-10-23 22:14:59 +00:00

104 lines
No EOL
2.8 KiB
Diff

--- wine-1.3.4/dlls/winhttp/net.c 2010-10-01 14:46:44.000000000 -0400
+++ dll/win32/winhttp/net.c 2010-10-09 17:04:11.000000000 -0400
@@ -158,6 +158,7 @@
#endif
/* translate a unix error code into a winsock error code */
+#if 0
static int sock_get_error( int err )
{
#if !defined(__MINGW32__) && !defined (_MSC_VER)
@@ -223,6 +224,9 @@
#endif
return err;
}
+#else
+#define sock_get_error(x) WSAGetLastError()
+#endif
#ifdef SONAME_LIBSSL
static PCCERT_CONTEXT X509_to_cert_context(X509 *cert)
@@ -632,11 +636,16 @@
res = sock_get_error( errno );
if (res == WSAEWOULDBLOCK || res == WSAEINPROGRESS)
{
- struct pollfd pfd;
+ fd_set outfd;
+ struct timeval tv;
+
+ FD_ZERO(&outfd);
+ FD_SET(conn->socket, &outfd);
- pfd.fd = conn->socket;
- pfd.events = POLLOUT;
- if (poll( &pfd, 1, timeout ) > 0)
+ tv.tv_sec = 0;
+ tv.tv_usec = timeout * 1000;
+
+ if (select( 0, NULL, &outfd, NULL, &tv ) > 0)
ret = TRUE;
else
res = sock_get_error( errno );
@@ -832,7 +841,7 @@
BOOL netconn_get_next_line( netconn_t *conn, char *buffer, DWORD *buflen )
{
- struct pollfd pfd;
+ fd_set infd;
BOOL ret = FALSE;
DWORD recvd = 0;
@@ -867,20 +876,22 @@
return FALSE;
#endif
}
-
- pfd.fd = conn->socket;
- pfd.events = POLLIN;
+
+ FD_ZERO(&infd);
+ FD_SET(conn->socket, &infd);
+
while (recvd < *buflen)
{
- int timeout, res;
- struct timeval tv;
+ int res;
+ struct timeval tv, *ptv;
socklen_t len = sizeof(tv);
if ((res = getsockopt( conn->socket, SOL_SOCKET, SO_RCVTIMEO, (void*)&tv, &len ) != -1))
- timeout = tv.tv_sec * 1000 + tv.tv_usec / 1000;
+ ptv = &tv;
else
- timeout = -1;
- if (poll( &pfd, 1, timeout ) > 0)
+ ptv = NULL;
+
+ if (select( 0, &infd, NULL, NULL, ptv ) > 0)
{
if ((res = recv( conn->socket, &buffer[recvd], 1, 0 )) <= 0)
{
--- wine-1.3.4/dlls/winhttp/session.c 2010-10-01 14:46:44.000000000 -0400
+++ dll/win32/winhttp/session.c 2010-10-09 17:04:11.000000000 -0400
@@ -38,6 +38,9 @@
#define DEFAULT_SEND_TIMEOUT 30000
#define DEFAULT_RECEIVE_TIMEOUT 30000
+/* FIXME */
+#define CP_UNIXCP CP_ACP
+
void set_last_error( DWORD error )
{
/* FIXME */
--- wine-1.3.4/dlls/winhttp/request.c 2010-10-01 14:46:44.000000000 -0400
+++ dll/win32/winhttp/request.c 2010-10-09 17:04:11.000000000 -0400
@@ -34,6 +34,8 @@
#include "winhttp_private.h"
+#include "inet_ntop.c"
+
WINE_DEFAULT_DEBUG_CHANNEL(winhttp);
static const WCHAR attr_accept[] = {'A','c','c','e','p','t',0};