1 --- wine-1.5.4/dlls/wininet/internet.h 2012-06-20 14:38:39 +0200
2 +++ dll/win32/wininet/internet.h 2012-06-20 16:49:05 +0200
3 @@ -536,7 +536,30 @@ BOOL NETCON_is_alive(netconn_t*) DECLSPE
4 LPCVOID NETCON_GetCert(netconn_t *connection) DECLSPEC_HIDDEN;
5 int NETCON_GetCipherStrength(netconn_t*) DECLSPEC_HIDDEN;
6 DWORD NETCON_set_timeout(netconn_t *connection, BOOL send, DWORD value) DECLSPEC_HIDDEN;
8 int sock_get_error(int) DECLSPEC_HIDDEN;
10 +#define sock_get_error(x) WSAGetLastError()
11 +const char *inet_ntop(int, const void *, char *, socklen_t);
13 +static inline long unix_recv(int socket, void *buffer, size_t length, int flags)
15 + return recv(socket, buffer, length, flags);
17 +#define recv unix_recv
19 +static inline int unix_ioctl(int filedes, long request, void *arg)
21 + return ioctlsocket(filedes, request, arg);
23 +#define ioctlsocket unix_ioctl
25 +static inline int unix_getsockopt(int socket, int level, int option_name, void *option_value, socklen_t *option_len)
27 + return getsockopt(socket, level, option_name, option_value, option_len);
29 +#define getsockopt unix_getsockopt
32 extern void URLCacheContainers_CreateDefaults(void) DECLSPEC_HIDDEN;
33 extern void URLCacheContainers_DeleteAll(void) DECLSPEC_HIDDEN;
34 --- wine-1.5.4/dlls/wininet/netconnection.c 2012-06-20 14:38:39 +0200
35 +++ dll/win32/wininet/netconnection.c 2012-06-20 15:50:06 +0200
36 @@ -523,12 +523,16 @@ DWORD create_netconn(BOOL useSSL, server
39 if (sock_get_error(errno) == WSAEINPROGRESS) {
41 + // ReactOS: use select instead of poll
46 - pfd.fd = netconn->socketFD;
47 - pfd.events = POLLOUT;
48 - res = poll(&pfd, 1, timeout);
50 + FD_SET(netconn->socketFD, &outfd);
51 + tv.tv_sec = timeout / 1000;
52 + tv.tv_usec = (timeout % 1000) * 1000;
53 + res = select(0, NULL, &outfd, NULL, &tv);
56 closesocket(netconn->socketFD);
57 @@ -612,6 +616,7 @@ void NETCON_unload(void)
62 /* translate a unix error code into a winsock one */
63 int sock_get_error( int err )
65 @@ -678,6 +683,7 @@ int sock_get_error( int err )
71 /******************************************************************************
72 * NETCON_secure_connect
73 --- wine-1.5.4/dlls/wininet/internet.c 2012-06-20 14:38:38 +0200
74 +++ dll/win32/wininet/internet.c 2012-06-20 15:50:05 +0200
75 @@ -292,7 +292,9 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL,
76 if (g_dwTlsErrIndex == TLS_OUT_OF_INDEXES)
80 URLCacheContainers_CreateDefaults();
83 WININET_hModule = hinstDLL;
85 @@ -3716,19 +3718,23 @@ LPSTR INTERNET_GetResponseBuffer(void)
87 LPSTR INTERNET_GetNextLine(INT nSocket, LPDWORD dwLen)
90 + // ReactOS: use select instead of poll
93 BOOL bSuccess = FALSE;
95 LPSTR lpszBuffer = INTERNET_GetResponseBuffer();
100 - pfd.events = POLLIN;
102 + FD_SET(nSocket,&infd);
103 + tv.tv_sec = RESPONSE_TIMEOUT;
106 while (nRecv < MAX_REPLY_LEN)
108 - if (poll(&pfd,1, RESPONSE_TIMEOUT * 1000) > 0)
109 + if (select(0, &infd, NULL, NULL, &tv) > 0)
111 if (recv(nSocket, &lpszBuffer[nRecv], 1, 0) <= 0)
113 --- wine-1.5.4/dlls/wininet/urlcache.c 2012-06-20 14:30:41 +0200
114 +++ dll/win32/wininet/urlcache.c 2012-06-20 15:50:06 +0200
115 @@ -189,6 +189,8 @@ typedef struct _URLCACHECONTAINER
117 /* List of all containers available */
118 static struct list UrlContainers = LIST_INIT(UrlContainers);
120 +BOOL bDefaultContainersAdded = FALSE;
122 static DWORD URLCache_CreateHashTable(LPURLCACHE_HEADER pHeader, HASH_CACHEFILE_ENTRY *pPrevHash, HASH_CACHEFILE_ENTRY **ppHash);
124 @@ -538,6 +540,8 @@ void URLCacheContainers_CreateDefaults(v
125 static const WCHAR HistoryPrefix[] = {'V','i','s','i','t','e','d',':',0};
126 static const WCHAR CookieSuffix[] = {0};
127 static const WCHAR CookiePrefix[] = {'C','o','o','k','i','e',':',0};
129 + static const WCHAR UserProfile[] = {'U','S','E','R','P','R','O','F','I','L','E',0};
132 int nFolder; /* CSIDL_* constant */
133 @@ -551,6 +555,13 @@ void URLCacheContainers_CreateDefaults(v
138 + if (GetEnvironmentVariableW(UserProfile, NULL, 0) == 0 && GetLastError() == ERROR_ENVVAR_NOT_FOUND)
140 + TRACE("Environment variable 'USERPROFILE' does not exist!\n");
144 for (i = 0; i < sizeof(DefaultContainerData) / sizeof(DefaultContainerData[0]); i++)
146 WCHAR wszCachePath[MAX_PATH];
147 @@ -604,6 +615,10 @@ static DWORD URLCacheContainers_FindCont
149 return ERROR_INVALID_PARAMETER;
152 + if (!bDefaultContainersAdded)
153 + URLCacheContainers_CreateDefaults();
155 LIST_FOR_EACH_ENTRY(pContainer, &UrlContainers, URLCACHECONTAINER, entry)
157 int prefix_len = strlenW(pContainer->cache_prefix);
158 @@ -642,6 +657,10 @@ static BOOL URLCacheContainers_Enum(LPCW
159 if (lpwszSearchPattern && dwIndex > 0)
163 + if (!bDefaultContainersAdded)
164 + URLCacheContainers_CreateDefaults();
166 LIST_FOR_EACH_ENTRY(pContainer, &UrlContainers, URLCACHECONTAINER, entry)
168 if (lpwszSearchPattern)
169 @@ -1579,6 +1598,10 @@ BOOL WINAPI FreeUrlCacheSpaceW(LPCWSTR l
174 + if (!bDefaultContainersAdded)
175 + URLCacheContainers_CreateDefaults();
177 LIST_FOR_EACH_ENTRY(pContainer, &UrlContainers, URLCACHECONTAINER, entry)
179 /* The URL cache has prefix L"" (unlike Cookies and History) */
180 --- wine-1.5.4/dlls/wininet/http.c 2012-06-20 15:19:57 +0200
181 +++ dll/win32/wininet/http.c 2012-06-20 16:24:11 +0200
183 #include "wine/exception.h"
184 #include "wine/unicode.h"
187 +#include "inet_ntop.c"
189 WINE_DEFAULT_DEBUG_CHANNEL(wininet);
191 static const WCHAR g_szHttp1_0[] = {'H','T','T','P','/','1','.','0',0};
192 @@ -241,8 +244,17 @@ void server_release(server_t *server)
193 if(InterlockedDecrement(&server->ref))
198 - server->keep_until = GetTickCount64() + COLLECT_TIME;
199 + server->keep_until = (DWORD64)GetTickCount() + COLLECT_TIME;
201 + EnterCriticalSection(&connection_pool_cs);
202 + list_remove(&server->entry);
203 + LeaveCriticalSection(&connection_pool_cs);
205 + heap_free(server->name);
210 static server_t *get_server(const WCHAR *name, INTERNET_PORT port)
211 @@ -288,7 +300,7 @@ BOOL collect_connections(BOOL collect_al
212 BOOL remaining = FALSE;
215 - now = GetTickCount64();
216 + now = GetTickCount();
218 LIST_FOR_EACH_ENTRY_SAFE(server, server_safe, &connection_pool, server_t, entry) {
219 LIST_FOR_EACH_ENTRY_SAFE(netconn, netconn_safe, &server->conn_pool, netconn_t, pool_entry) {
220 @@ -1854,13 +1866,14 @@ static void http_release_netconn(http_re
225 if(reuse && req->netconn->keep_alive) {
228 EnterCriticalSection(&connection_pool_cs);
230 list_add_head(&req->netconn->server->conn_pool, &req->netconn->pool_entry);
231 - req->netconn->keep_until = GetTickCount64() + COLLECT_TIME;
232 + req->netconn->keep_until = (DWORD64)GetTickCount() + COLLECT_TIME;
235 run_collector = !collector_running;
236 @@ -1888,6 +1901,10 @@ static void http_release_netconn(http_re
241 + // silence unused function warning
242 + (void)collect_connections_proc;
245 INTERNET_SendCallback(&req->hdr, req->hdr.dwContext,
246 INTERNET_STATUS_CLOSING_CONNECTION, 0, 0);