mirror of
https://github.com/reactos/reactos.git
synced 2024-11-04 13:52:30 +00:00
185 lines
5.9 KiB
Diff
185 lines
5.9 KiB
Diff
diff -pudN e:\wine\dlls\wininet/http.c e:\reactos\dll\win32\wininet/http.c
|
|
--- e:\wine\dlls\wininet/http.c 2016-11-16 17:36:38 +0100
|
|
+++ e:\reactos\dll\win32\wininet/http.c 2016-11-17 00:15:58 +0100
|
|
@@ -118,6 +118,7 @@ static const WCHAR emptyW[] = {0};
|
|
|
|
#define COLLECT_TIME 60000
|
|
|
|
+#undef ARRAYSIZE
|
|
#define ARRAYSIZE(array) (sizeof(array)/sizeof((array)[0]))
|
|
|
|
struct HttpAuthInfo
|
|
@@ -203,7 +204,13 @@ void server_release(server_t *server)
|
|
if(InterlockedDecrement(&server->ref))
|
|
return;
|
|
|
|
+#ifdef __REACTOS__
|
|
+ EnterCriticalSection(&connection_pool_cs);
|
|
+#endif
|
|
list_remove(&server->entry);
|
|
+#ifdef __REACTOS__
|
|
+ LeaveCriticalSection(&connection_pool_cs);
|
|
+#endif
|
|
|
|
if(server->cert_chain)
|
|
CertFreeCertificateChain(server->cert_chain);
|
|
@@ -286,7 +293,11 @@ BOOL collect_connections(collect_type_t
|
|
BOOL remaining = FALSE;
|
|
DWORD64 now;
|
|
|
|
+#ifdef __REACTOS__
|
|
+ now = GetTickCount();
|
|
+#else
|
|
now = GetTickCount64();
|
|
+#endif
|
|
|
|
LIST_FOR_EACH_ENTRY_SAFE(server, server_safe, &connection_pool, server_t, entry) {
|
|
LIST_FOR_EACH_ENTRY_SAFE(netconn, netconn_safe, &server->conn_pool, netconn_t, pool_entry) {
|
|
@@ -1933,13 +1944,14 @@ static void http_release_netconn(http_re
|
|
if(!is_valid_netconn(req->netconn))
|
|
return;
|
|
|
|
+#ifndef __REACTOS__
|
|
if(reuse && req->netconn->keep_alive) {
|
|
BOOL run_collector;
|
|
|
|
EnterCriticalSection(&connection_pool_cs);
|
|
|
|
list_add_head(&req->netconn->server->conn_pool, &req->netconn->pool_entry);
|
|
- req->netconn->keep_until = GetTickCount64() + COLLECT_TIME;
|
|
+ req->netconn->keep_until = (DWORD64)GetTickCount() + COLLECT_TIME;
|
|
req->netconn = NULL;
|
|
|
|
run_collector = !collector_running;
|
|
@@ -1967,6 +1979,10 @@ static void http_release_netconn(http_re
|
|
}
|
|
return;
|
|
}
|
|
+#else
|
|
+ /* Silence unused function warning */
|
|
+ (void)collect_connections_proc;
|
|
+#endif
|
|
|
|
INTERNET_SendCallback(&req->hdr, req->hdr.dwContext,
|
|
INTERNET_STATUS_CLOSING_CONNECTION, 0, 0);
|
|
diff -pudN e:\wine\dlls\wininet/internet.c e:\reactos\dll\win32\wininet/internet.c
|
|
--- e:\wine\dlls\wininet/internet.c 2016-11-16 17:36:38 +0100
|
|
+++ e:\reactos\dll\win32\wininet/internet.c 2016-08-15 17:12:14 +0100
|
|
@@ -963,6 +963,9 @@ HINTERNET WINAPI InternetOpenW(LPCWSTR l
|
|
{
|
|
appinfo_t *lpwai = NULL;
|
|
|
|
+#ifdef __REACTOS__
|
|
+ init_winsock();
|
|
+#endif
|
|
if (TRACE_ON(wininet)) {
|
|
#define FE(x) { x, #x }
|
|
static const wininet_flag_info access_type[] = {
|
|
|
|
diff -pudN e:\wine\dlls\wininet/netconnection.c e:\reactos\dll\win32\wininet/netconnection.c
|
|
--- e:\wine\dlls\wininet/netconnection.c 2016-11-16 17:36:38 +0100
|
|
+++ e:\reactos\dll\win32\wininet/netconnection.c 2016-10-13 11:15:37 +0100
|
|
@@ -259,7 +259,7 @@ static BOOL WINAPI winsock_startup(INIT_
|
|
WSADATA wsa_data;
|
|
DWORD res;
|
|
|
|
- res = WSAStartup(MAKEWORD(1,1), &wsa_data);
|
|
+ res = WSAStartup(MAKEWORD(2,2), &wsa_data);
|
|
if(res == ERROR_SUCCESS)
|
|
winsock_loaded = TRUE;
|
|
else
|
|
diff -pudN e:\wine\dlls\wininet/urlcache.c e:\reactos\dll\win32\wininet/urlcache.c
|
|
--- e:\wine\dlls\wininet/urlcache.c 2016-11-16 17:36:38 +0100
|
|
+++ e:\reactos\dll\win32\wininet/urlcache.c 2016-11-17 00:16:23 +0100
|
|
@@ -179,6 +179,8 @@ typedef struct
|
|
|
|
/* List of all containers available */
|
|
static struct list UrlContainers = LIST_INIT(UrlContainers);
|
|
+/* ReactOS r54992 */
|
|
+BOOL bDefaultContainersAdded = FALSE;
|
|
|
|
static inline char *heap_strdupWtoUTF8(LPCWSTR str)
|
|
{
|
|
@@ -729,6 +731,8 @@ static void cache_containers_init(void)
|
|
static const WCHAR UrlSuffix[] = {'C','o','n','t','e','n','t','.','I','E','5',0};
|
|
static const WCHAR HistorySuffix[] = {'H','i','s','t','o','r','y','.','I','E','5',0};
|
|
static const WCHAR CookieSuffix[] = {0};
|
|
+ /* ReactOS r50916 */
|
|
+ static const WCHAR UserProfile[] = {'U','S','E','R','P','R','O','F','I','L','E',0};
|
|
static const struct
|
|
{
|
|
int nFolder; /* CSIDL_* constant */
|
|
@@ -743,6 +747,13 @@ static void cache_containers_init(void)
|
|
};
|
|
DWORD i;
|
|
|
|
+ /* ReactOS r50916 */
|
|
+ if (GetEnvironmentVariableW(UserProfile, NULL, 0) == 0 && GetLastError() == ERROR_ENVVAR_NOT_FOUND)
|
|
+ {
|
|
+ ERR("Environment variable 'USERPROFILE' does not exist!\n");
|
|
+ return;
|
|
+ }
|
|
+
|
|
for (i = 0; i < sizeof(DefaultContainerData) / sizeof(DefaultContainerData[0]); i++)
|
|
{
|
|
WCHAR wszCachePath[MAX_PATH];
|
|
@@ -793,6 +804,10 @@ static void cache_containers_init(void)
|
|
cache_containers_add(DefaultContainerData[i].cache_prefix, wszCachePath,
|
|
DefaultContainerData[i].default_entry_type, wszMutexName);
|
|
}
|
|
+
|
|
+#ifdef __REACTOS__
|
|
+ bDefaultContainersAdded = TRUE;
|
|
+#endif
|
|
}
|
|
|
|
static void cache_containers_free(void)
|
|
@@ -812,6 +827,12 @@ static DWORD cache_containers_find(const
|
|
if(!url)
|
|
return ERROR_INVALID_PARAMETER;
|
|
|
|
+#ifdef __REACTOS__
|
|
+ /* ReactOS r54992 */
|
|
+ if (!bDefaultContainersAdded)
|
|
+ cache_containers_init();
|
|
+#endif
|
|
+
|
|
LIST_FOR_EACH_ENTRY(container, &UrlContainers, cache_container, entry)
|
|
{
|
|
int prefix_len = strlen(container->cache_prefix);
|
|
@@ -838,6 +859,12 @@ static BOOL cache_containers_enum(char *
|
|
if (search_pattern && index > 0)
|
|
return FALSE;
|
|
|
|
+#ifdef __REACTOS__
|
|
+ /* ReactOS r54992 */
|
|
+ if (!bDefaultContainersAdded)
|
|
+ cache_containers_init();
|
|
+#endif
|
|
+
|
|
LIST_FOR_EACH_ENTRY(container, &UrlContainers, cache_container, entry)
|
|
{
|
|
if (search_pattern)
|
|
@@ -3995,7 +4022,9 @@ BOOL init_urlcache(void)
|
|
return FALSE;
|
|
}
|
|
|
|
+#ifndef __REACTOS__
|
|
cache_containers_init();
|
|
+#endif
|
|
return TRUE;
|
|
}
|
|
|
|
diff -pudN e:\wine\dlls\wininet/utility.c e:\reactos\dll\win32\wininet/utility.c
|
|
--- e:\wine\dlls\wininet/utility.c 2016-11-16 17:36:38 +0100
|
|
+++ e:\reactos\dll\win32\wininet/utility.c 2016-08-15 17:12:40 +0100
|
|
@@ -24,6 +24,9 @@
|
|
|
|
#include "internet.h"
|
|
|
|
+// ReactOS
|
|
+#include "inet_ntop.c"
|
|
+
|
|
#define TIME_STRING_LEN 30
|
|
|
|
time_t ConvertTimeString(LPCWSTR asctime)
|