[WININET] Sync with Wine Staging 1.9.23. CORE-12409
authorAmine Khaldi <amine.khaldi@reactos.org>
Wed, 23 Nov 2016 18:09:57 +0000 (18:09 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Wed, 23 Nov 2016 18:09:57 +0000 (18:09 +0000)
4695681 wininet: add ParseX509EncodedCertificateForListBoxEntry stub (try 2)
e3e4fc6 wininet: Add support for INTERNET_OPTION_SETTINGS_CHANGED in InternetSetOption.
4a728d2 wininet: Allow INTERNET_OPTION_SETTINGS_CHANGED on connections.
8478c72 wininet: Resize buffer when call to InternetCanonicalizeUrlW fails in InternetCrackUrlW.
3d6da00 wininet: Handle INTERNET_INVALID_PORT_NUMBER in HttpOpenRequest.
dee155f wininet: Replacing header fields should fail if they do not exist yet.
efd7d44 wininet: Strip filename if no path is set in cookie.
65f5d89 wininet: Silence wininet no support on this platform message.
3cb027c wininet: Increase buffer in _test_status_code to avoid potential potential overflow.
7e84143 wininet: Don't crash by debug printing too long URLs.
7d9a439 wininet: Don't return available data sizes larger than the read buffer.

svn path=/trunk/; revision=73360

reactos/dll/win32/wininet/http.c
reactos/dll/win32/wininet/urlcache.c
reactos/dll/win32/wininet/wininet_ros.diff
reactos/media/doc/README.WINE

index c858250..24c6cff 100644 (file)
@@ -2619,7 +2619,16 @@ static DWORD refill_read_buffer(http_request_t *req, blocking_mode_t blocking_mo
 /* return the size of data available to be read immediately (the read section must be held) */
 static DWORD get_avail_data( http_request_t *req )
 {
 /* return the size of data available to be read immediately (the read section must be held) */
 static DWORD get_avail_data( http_request_t *req )
 {
-    return req->read_size + req->data_stream->vtbl->get_avail_data(req->data_stream, req);
+    DWORD avail = req->read_size;
+
+    /*
+     * Different Windows versions have different limits of returned data, but all
+     * of them return no more than centrain amount. We use READ_BUFFER_SIZE as a limit.
+     */
+    if(avail < READ_BUFFER_SIZE)
+        avail += req->data_stream->vtbl->get_avail_data(req->data_stream, req);
+
+    return min(avail, READ_BUFFER_SIZE);
 }
 
 static DWORD netconn_get_avail_data(data_stream_t *stream, http_request_t *req)
 }
 
 static DWORD netconn_get_avail_data(data_stream_t *stream, http_request_t *req)
index 81954e3..6121b65 100644 (file)
@@ -2566,7 +2566,7 @@ BOOL WINAPI UnlockUrlCacheEntryFileA(LPCSTR lpszUrlName, DWORD dwReserved)
     if (!urlcache_find_hash_entry(pHeader, lpszUrlName, &pHashEntry))
     {
         cache_container_unlock_index(pContainer, pHeader);
     if (!urlcache_find_hash_entry(pHeader, lpszUrlName, &pHashEntry))
     {
         cache_container_unlock_index(pContainer, pHeader);
-        TRACE("entry %s not found!\n", lpszUrlName);
+        TRACE("entry %s not found!\n", debugstr_a(lpszUrlName));
         SetLastError(ERROR_FILE_NOT_FOUND);
         return FALSE;
     }
         SetLastError(ERROR_FILE_NOT_FOUND);
         return FALSE;
     }
@@ -3313,7 +3313,7 @@ BOOL WINAPI DeleteUrlCacheEntryA(LPCSTR lpszUrlName)
     if (!urlcache_find_hash_entry(pHeader, lpszUrlName, &pHashEntry))
     {
         cache_container_unlock_index(pContainer, pHeader);
     if (!urlcache_find_hash_entry(pHeader, lpszUrlName, &pHashEntry))
     {
         cache_container_unlock_index(pContainer, pHeader);
-        TRACE("entry %s not found!\n", lpszUrlName);
+        TRACE("entry %s not found!\n", debugstr_a(lpszUrlName));
         SetLastError(ERROR_FILE_NOT_FOUND);
         return FALSE;
     }
         SetLastError(ERROR_FILE_NOT_FOUND);
         return FALSE;
     }
index e5b5e51..5fe9893 100644 (file)
@@ -1,6 +1,6 @@
 diff -pudN e:\wine\dlls\wininet/http.c e:\reactos\dll\win32\wininet/http.c
 diff -pudN e:\wine\dlls\wininet/http.c e:\reactos\dll\win32\wininet/http.c
---- e:\wine\dlls\wininet/http.c        2016-05-31 18:02:43 +0100
-+++ e:\reactos\dll\win32\wininet/http.c        2016-07-02 16:18:16 +0100
+--- 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
 @@ -118,6 +118,7 @@ static const WCHAR emptyW[] = {0};
  
  #define COLLECT_TIME 60000
@@ -35,7 +35,7 @@ diff -pudN e:\wine\dlls\wininet/http.c e:\reactos\dll\win32\wininet/http.c
  
      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) {
  
      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) {
-@@ -1923,13 +1934,14 @@ static void http_release_netconn(http_re
+@@ -1933,13 +1944,14 @@ static void http_release_netconn(http_re
      if(!is_valid_netconn(req->netconn))
          return;
  
      if(!is_valid_netconn(req->netconn))
          return;
  
@@ -51,7 +51,7 @@ diff -pudN e:\wine\dlls\wininet/http.c e:\reactos\dll\win32\wininet/http.c
          req->netconn = NULL;
  
          run_collector = !collector_running;
          req->netconn = NULL;
  
          run_collector = !collector_running;
-@@ -1957,6 +1969,10 @@ static void http_release_netconn(http_re
+@@ -1967,6 +1979,10 @@ static void http_release_netconn(http_re
          }
          return;
      }
          }
          return;
      }
@@ -63,8 +63,8 @@ diff -pudN e:\wine\dlls\wininet/http.c e:\reactos\dll\win32\wininet/http.c
      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
      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-05-31 18:05:36 +0100
-+++ e:\reactos\dll\win32\wininet/internet.c    2016-07-02 16:18:16 +0100
+--- 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;
 @@ -963,6 +963,9 @@ HINTERNET WINAPI InternetOpenW(LPCWSTR l
  {
      appinfo_t *lpwai = NULL;
@@ -76,9 +76,21 @@ diff -pudN e:\wine\dlls\wininet/internet.c e:\reactos\dll\win32\wininet/internet
  #define FE(x) { x, #x }
        static const wininet_flag_info access_type[] = {
 
  #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
 diff -pudN e:\wine\dlls\wininet/urlcache.c e:\reactos\dll\win32\wininet/urlcache.c
---- e:\wine\dlls\wininet/urlcache.c    2016-05-31 18:02:43 +0100
-+++ e:\reactos\dll\win32\wininet/urlcache.c    2016-07-02 16:18:16 +0100
+--- 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 */
 @@ -179,6 +179,8 @@ typedef struct
  
  /* List of all containers available */
@@ -158,3 +170,16 @@ diff -pudN e:\wine\dlls\wininet/urlcache.c e:\reactos\dll\win32\wininet/urlcache
      return TRUE;
  }
  
      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)
index 4eede80..1cc3b06 100644 (file)
@@ -201,7 +201,7 @@ reactos/dll/win32/windowscodecsext    # Synced to WineStaging-1.9.11
 reactos/dll/win32/winemp3.acm         # Synced to WineStaging-1.9.23
 reactos/dll/win32/wing32              # Synced to WineStaging-1.9.11
 reactos/dll/win32/winhttp             # Synced to WineStaging-1.9.23
 reactos/dll/win32/winemp3.acm         # Synced to WineStaging-1.9.23
 reactos/dll/win32/wing32              # Synced to WineStaging-1.9.11
 reactos/dll/win32/winhttp             # Synced to WineStaging-1.9.23
-reactos/dll/win32/wininet             # Synced to WineStaging-1.9.16
+reactos/dll/win32/wininet             # Synced to WineStaging-1.9.23
 reactos/dll/win32/winmm               # Forked at Wine-20050628
 reactos/dll/win32/winmm/midimap       # Forked at Wine-20050628
 reactos/dll/win32/winmm/wavemap       # Forked at Wine-20050628
 reactos/dll/win32/winmm               # Forked at Wine-20050628
 reactos/dll/win32/winmm/midimap       # Forked at Wine-20050628
 reactos/dll/win32/winmm/wavemap       # Forked at Wine-20050628