reactos/dll/win32/wininet/wininet_ros.diff
Cameron Gutman c2d0d784c7 [USB-BRINGUP-TRUNK]
- Create a branch to do a proper merge of USB work from a trunk base instead of from cmake-bringup
- In the future, DO NOT under any circumstances branch another branch. This leads to merge problems!

svn path=/branches/usb-bringup-trunk/; revision=55018
2012-01-20 20:58:46 +00:00

179 lines
5.4 KiB
Diff

--- wine-1.3.4/dlls/wininet/internet.h 2010-10-01 14:46:44.000000000 -0400
+++ dll/win32/wininet/internet.h 2010-10-09 15:34:13.000000000 -0400
@@ -462,7 +462,7 @@
LPCVOID NETCON_GetCert(WININET_NETCONNECTION *connection);
int NETCON_GetCipherStrength(WININET_NETCONNECTION *connection);
DWORD NETCON_set_timeout(WININET_NETCONNECTION *connection, BOOL send, int value);
-int sock_get_error(int);
+#define sock_get_error(x) WSAGetLastError()
extern void URLCacheContainers_CreateDefaults(void);
extern void URLCacheContainers_DeleteAll(void);
--- wine-1.3.4/dlls/wininet/http.c 2010-10-01 14:46:44.000000000 -0400
+++ dll/win32/wininet/http.c 2010-10-09 15:28:29.000000000 -0400
@@ -69,6 +69,8 @@
#include "wine/exception.h"
#include "wine/unicode.h"
+#include "inet_ntop.c"
+
WINE_DEFAULT_DEBUG_CHANNEL(wininet);
static const WCHAR g_szHttp1_0[] = {'H','T','T','P','/','1','.','0',0};
--- wine-1.3.4/dlls/wininet/netconnection.c 2010-10-01 14:46:44.000000000 -0400
+++ dll/win32/wininet/netconnection.c 2010-10-09 15:33:53.000000000 -0400
@@ -547,6 +547,7 @@
return TRUE;
}
+#if 0
/* translate a unix error code into a winsock one */
int sock_get_error( int err )
{
@@ -613,6 +614,7 @@
#endif
return err;
}
+#endif
/******************************************************************************
* NETCON_create
--- wine-1.3.4/dlls/wininet/internet.c 2010-10-01 14:46:44.000000000 -0400
+++ dll/win32/wininet/internet.c 2010-10-09 15:33:04.000000000 -0400
@@ -292,8 +292,6 @@
if (g_dwTlsErrIndex == TLS_OUT_OF_INDEXES)
return FALSE;
- URLCacheContainers_CreateDefaults();
-
WININET_hModule = hinstDLL;
case DLL_THREAD_ATTACH:
@@ -3569,19 +3567,22 @@
LPSTR INTERNET_GetNextLine(INT nSocket, LPDWORD dwLen)
{
- struct pollfd pfd;
+ fd_set infd;
+ struct timeval tv;
BOOL bSuccess = FALSE;
INT nRecv = 0;
LPSTR lpszBuffer = INTERNET_GetResponseBuffer();
TRACE("\n");
- pfd.fd = nSocket;
- pfd.events = POLLIN;
+ FD_ZERO(&infd);
+ FD_SET(nSocket,&infd);
+ tv.tv_sec = RESPONSE_TIMEOUT;
+ tv.tv_usec = 0;
while (nRecv < MAX_REPLY_LEN)
{
- if (poll(&pfd,1, RESPONSE_TIMEOUT * 1000) > 0)
+ if (select(0, &infd, NULL, NULL, &tv) > 0)
{
if (recv(nSocket, &lpszBuffer[nRecv], 1, 0) <= 0)
{
Index: dll/win32/wininet/urlcache.c
===================================================================
--- dll/win32/wininet/urlcache.c (revision 50814)
+++ dll/win32/wininet/urlcache.c (working copy)
@@ -182,6 +182,7 @@
/* List of all containers available */
static struct list UrlContainers = LIST_INIT(UrlContainers);
+BOOL bDefaultContainersAdded = FALSE;
static DWORD URLCache_CreateHashTable(LPURLCACHE_HEADER pHeader, HASH_CACHEFILE_ENTRY *pPrevHash, HASH_CACHEFILE_ENTRY **ppHash);
@@ -527,6 +528,7 @@
static const WCHAR HistoryPrefix[] = {'V','i','s','i','t','e','d',':',0};
static const WCHAR CookieSuffix[] = {0};
static const WCHAR CookiePrefix[] = {'C','o','o','k','i','e',':',0};
+ static const WCHAR UserProfile[] = {'U','S','E','R','P','R','O','F','I','L','E',0};
static const struct
{
int nFolder; /* CSIDL_* constant */
@@ -540,6 +542,12 @@
};
DWORD i;
+ if (GetEnvironmentVariableW(UserProfile, NULL, 0) == 0 && GetLastError() == ERROR_ENVVAR_NOT_FOUND)
+ {
+ TRACE("Environment variable 'USERPROFILE' does not exist!\n");
+ return;
+ }
+
for (i = 0; i < sizeof(DefaultContainerData) / sizeof(DefaultContainerData[0]); i++)
{
WCHAR wszCachePath[MAX_PATH];
@@ -584,6 +592,9 @@
if(!lpwszUrl)
return ERROR_INVALID_PARAMETER;
+ if (!bDefaultContainersAdded)
+ URLCacheContainers_CreateDefaults();
+
LIST_FOR_EACH_ENTRY(pContainer, &UrlContainers, URLCACHECONTAINER, entry)
{
int prefix_len = strlenW(pContainer->cache_prefix);
@@ -622,6 +633,9 @@
if (lpwszSearchPattern && dwIndex > 0)
return FALSE;
+ if (!bDefaultContainersAdded)
+ URLCacheContainers_CreateDefaults();
+
LIST_FOR_EACH_ENTRY(pContainer, &UrlContainers, URLCACHECONTAINER, entry)
{
if (lpwszSearchPattern)
@@ -1525,6 +1539,9 @@
return FALSE;
}
+ if (!bDefaultContainersAdded)
+ URLCacheContainers_CreateDefaults();
+
LIST_FOR_EACH_ENTRY(pContainer, &UrlContainers, URLCACHECONTAINER, entry)
{
/* The URL cache has prefix L"" (unlike Cookies and History) */
Index: dll/win32/wininet/http.c
===================================================================
--- dll/win32/wininet/http.c (revision 54234)
+++ dll/win32/wininet/http.c (working copy)
@@ -245,8 +245,17 @@
if(InterlockedDecrement(&server->ref))
return;
+#ifndef __REACTOS__
if(!server->ref)
server->keep_until = (DWORD64)GetTickCount() + COLLECT_TIME;
+#else
+ EnterCriticalSection(&connection_pool_cs);
+ list_remove(&server->entry);
+ LeaveCriticalSection(&connection_pool_cs);
+
+ heap_free(server->name);
+ heap_free(server);
+#endif
}
static server_t *get_server(const WCHAR *name, INTERNET_PORT port)
@@ -1861,6 +1870,7 @@
if(!req->netconn)
return;
+#ifndef __REACTOS__
if(reuse && req->netconn->keep_alive) {
BOOL run_collector;
@@ -1893,6 +1903,7 @@
}
return;
}
+#endif
INTERNET_SendCallback(&req->hdr, req->hdr.dwContext,
INTERNET_STATUS_CLOSING_CONNECTION, 0, 0);