[USB]
[reactos.git] / reactos / dll / win32 / wininet / wininet_ros.diff
1 --- wine-1.3.4/dlls/wininet/internet.h 2010-10-01 14:46:44.000000000 -0400
2 +++ dll/win32/wininet/internet.h 2010-10-09 15:34:13.000000000 -0400
3 @@ -462,7 +462,7 @@
4 LPCVOID NETCON_GetCert(WININET_NETCONNECTION *connection);
5 int NETCON_GetCipherStrength(WININET_NETCONNECTION *connection);
6 DWORD NETCON_set_timeout(WININET_NETCONNECTION *connection, BOOL send, int value);
7 -int sock_get_error(int);
8 +#define sock_get_error(x) WSAGetLastError()
9
10 extern void URLCacheContainers_CreateDefaults(void);
11 extern void URLCacheContainers_DeleteAll(void);
12 --- wine-1.3.4/dlls/wininet/http.c 2010-10-01 14:46:44.000000000 -0400
13 +++ dll/win32/wininet/http.c 2010-10-09 15:28:29.000000000 -0400
14 @@ -69,6 +69,8 @@
15 #include "wine/exception.h"
16 #include "wine/unicode.h"
17
18 +#include "inet_ntop.c"
19 +
20 WINE_DEFAULT_DEBUG_CHANNEL(wininet);
21
22 static const WCHAR g_szHttp1_0[] = {'H','T','T','P','/','1','.','0',0};
23 --- wine-1.3.4/dlls/wininet/netconnection.c 2010-10-01 14:46:44.000000000 -0400
24 +++ dll/win32/wininet/netconnection.c 2010-10-09 15:33:53.000000000 -0400
25 @@ -547,6 +547,7 @@
26 return TRUE;
27 }
28
29 +#if 0
30 /* translate a unix error code into a winsock one */
31 int sock_get_error( int err )
32 {
33 @@ -613,6 +614,7 @@
34 #endif
35 return err;
36 }
37 +#endif
38
39 /******************************************************************************
40 * NETCON_create
41 --- wine-1.3.4/dlls/wininet/internet.c 2010-10-01 14:46:44.000000000 -0400
42 +++ dll/win32/wininet/internet.c 2010-10-09 15:33:04.000000000 -0400
43 @@ -292,8 +292,6 @@
44 if (g_dwTlsErrIndex == TLS_OUT_OF_INDEXES)
45 return FALSE;
46
47 - URLCacheContainers_CreateDefaults();
48 -
49 WININET_hModule = hinstDLL;
50
51 case DLL_THREAD_ATTACH:
52 @@ -3569,19 +3567,22 @@
53
54 LPSTR INTERNET_GetNextLine(INT nSocket, LPDWORD dwLen)
55 {
56 - struct pollfd pfd;
57 + fd_set infd;
58 + struct timeval tv;
59 BOOL bSuccess = FALSE;
60 INT nRecv = 0;
61 LPSTR lpszBuffer = INTERNET_GetResponseBuffer();
62
63 TRACE("\n");
64
65 - pfd.fd = nSocket;
66 - pfd.events = POLLIN;
67 + FD_ZERO(&infd);
68 + FD_SET(nSocket,&infd);
69 + tv.tv_sec = RESPONSE_TIMEOUT;
70 + tv.tv_usec = 0;
71
72 while (nRecv < MAX_REPLY_LEN)
73 {
74 - if (poll(&pfd,1, RESPONSE_TIMEOUT * 1000) > 0)
75 + if (select(0, &infd, NULL, NULL, &tv) > 0)
76 {
77 if (recv(nSocket, &lpszBuffer[nRecv], 1, 0) <= 0)
78 {
79 Index: dll/win32/wininet/urlcache.c
80 ===================================================================
81 --- dll/win32/wininet/urlcache.c (revision 50814)
82 +++ dll/win32/wininet/urlcache.c (working copy)
83 @@ -182,6 +182,7 @@
84
85 /* List of all containers available */
86 static struct list UrlContainers = LIST_INIT(UrlContainers);
87 +BOOL bDefaultContainersAdded = FALSE;
88
89 static DWORD URLCache_CreateHashTable(LPURLCACHE_HEADER pHeader, HASH_CACHEFILE_ENTRY *pPrevHash, HASH_CACHEFILE_ENTRY **ppHash);
90
91 @@ -527,6 +528,7 @@
92 static const WCHAR HistoryPrefix[] = {'V','i','s','i','t','e','d',':',0};
93 static const WCHAR CookieSuffix[] = {0};
94 static const WCHAR CookiePrefix[] = {'C','o','o','k','i','e',':',0};
95 + static const WCHAR UserProfile[] = {'U','S','E','R','P','R','O','F','I','L','E',0};
96 static const struct
97 {
98 int nFolder; /* CSIDL_* constant */
99 @@ -540,6 +542,12 @@
100 };
101 DWORD i;
102
103 + if (GetEnvironmentVariableW(UserProfile, NULL, 0) == 0 && GetLastError() == ERROR_ENVVAR_NOT_FOUND)
104 + {
105 + TRACE("Environment variable 'USERPROFILE' does not exist!\n");
106 + return;
107 + }
108 +
109 for (i = 0; i < sizeof(DefaultContainerData) / sizeof(DefaultContainerData[0]); i++)
110 {
111 WCHAR wszCachePath[MAX_PATH];
112 @@ -584,6 +592,9 @@
113 if(!lpwszUrl)
114 return ERROR_INVALID_PARAMETER;
115
116 + if (!bDefaultContainersAdded)
117 + URLCacheContainers_CreateDefaults();
118 +
119 LIST_FOR_EACH_ENTRY(pContainer, &UrlContainers, URLCACHECONTAINER, entry)
120 {
121 int prefix_len = strlenW(pContainer->cache_prefix);
122 @@ -622,6 +633,9 @@
123 if (lpwszSearchPattern && dwIndex > 0)
124 return FALSE;
125
126 + if (!bDefaultContainersAdded)
127 + URLCacheContainers_CreateDefaults();
128 +
129 LIST_FOR_EACH_ENTRY(pContainer, &UrlContainers, URLCACHECONTAINER, entry)
130 {
131 if (lpwszSearchPattern)
132 @@ -1525,6 +1539,9 @@
133 return FALSE;
134 }
135
136 + if (!bDefaultContainersAdded)
137 + URLCacheContainers_CreateDefaults();
138 +
139 LIST_FOR_EACH_ENTRY(pContainer, &UrlContainers, URLCACHECONTAINER, entry)
140 {
141 /* The URL cache has prefix L"" (unlike Cookies and History) */
142 Index: dll/win32/wininet/http.c
143 ===================================================================
144 --- dll/win32/wininet/http.c (revision 54234)
145 +++ dll/win32/wininet/http.c (working copy)
146 @@ -245,8 +245,17 @@
147 if(InterlockedDecrement(&server->ref))
148 return;
149
150 +#ifndef __REACTOS__
151 if(!server->ref)
152 server->keep_until = (DWORD64)GetTickCount() + COLLECT_TIME;
153 +#else
154 + EnterCriticalSection(&connection_pool_cs);
155 + list_remove(&server->entry);
156 + LeaveCriticalSection(&connection_pool_cs);
157 +
158 + heap_free(server->name);
159 + heap_free(server);
160 +#endif
161 }
162
163 static server_t *get_server(const WCHAR *name, INTERNET_PORT port)
164 @@ -1861,6 +1870,7 @@
165 if(!req->netconn)
166 return;
167
168 +#ifndef __REACTOS__
169 if(reuse && req->netconn->keep_alive) {
170 BOOL run_collector;
171
172 @@ -1893,6 +1903,7 @@
173 }
174 return;
175 }
176 +#endif
177
178 INTERNET_SendCallback(&req->hdr, req->hdr.dwContext,
179 INTERNET_STATUS_CLOSING_CONNECTION, 0, 0);