--- net.c Wed Sep 03 14:46:10 2008 +++ net.c Sun Sep 07 10:54:26 2008 @@ -59,6 +59,7 @@ #define DEFAULT_SEND_TIMEOUT 30 #define DEFAULT_RECEIVE_TIMEOUT 30 +#define RESPONSE_TIMEOUT 30 #ifndef HAVE_GETADDRINFO @@ -110,6 +111,7 @@ #endif +#if 0 /* translate a unix error code into a winsock error code */ static int sock_get_error( int err ) { @@ -174,6 +176,9 @@ } return err; } +#else +#define sock_get_error(x) WSAGetLastError() +#endif BOOL netconn_init( netconn_t *conn, BOOL secure ) { @@ -282,7 +287,7 @@ conn->secure = FALSE; } #endif - res = close( conn->socket ); + res = closesocket( conn->socket ); conn->socket = -1; if (res == -1) { @@ -463,7 +468,7 @@ return TRUE; } #ifdef FIONREAD - if (!(ret = ioctl( conn->socket, FIONREAD, &unread ))) + if (!(ret = ioctlsocket( conn->socket, FIONREAD, &unread ))) { TRACE("%d bytes of queued, but unread data\n", unread); *available += unread; @@ -474,7 +479,8 @@ BOOL netconn_get_next_line( netconn_t *conn, char *buffer, DWORD *buflen ) { - struct pollfd pfd; + struct timeval tv; + fd_set infd; BOOL ret = FALSE; DWORD recvd = 0; @@ -516,11 +522,13 @@ #endif } - pfd.fd = conn->socket; - pfd.events = POLLIN; + FD_ZERO(&infd); + FD_SET(conn->socket, &infd); + tv.tv_sec=RESPONSE_TIMEOUT; + tv.tv_usec=0; while (recvd < *buflen) { - if (poll( &pfd, 1, DEFAULT_RECEIVE_TIMEOUT * 1000 ) > 0) + if (select(conn->socket+1,&infd,NULL,NULL,&tv) > 0) { int res; if ((res = recv( conn->socket, &buffer[recvd], 1, 0 )) <= 0) --- request.c Fri Sep 05 17:34:17 2008 +++ request.c Sun Sep 07 11:29:55 2008 @@ -20,6 +20,7 @@ #include "wine/port.h" #include "wine/debug.h" +#include #include #ifdef HAVE_ARPA_INET_H # include @@ -33,6 +34,8 @@ #include "winhttp.h" #include "winhttp_private.h" + +#include "inet_ntop.c" WINE_DEFAULT_DEBUG_CHANNEL(winhttp); --- winhttp_private.h Thu Sep 04 15:27:29 2008 +++ winhttp_private.h Sun Sep 07 10:46:54 2008 @@ -33,8 +33,14 @@ # include #endif #if defined(__MINGW32__) || defined (_MSC_VER) -# include -#endif +# include "ws2tcpip.h" +# ifndef MSG_WAITALL +# define MSG_WAITALL 0 +# endif +#else +# define closesocket close +# define ioctlsocket ioctl +#endif /* __MINGW32__ */ typedef struct _object_header_t object_header_t;