Module: wine Branch: master Commit: bd42c0416a5db8c607d7dd7bf1576d68af4ca895 URL: http://source.winehq.org/git/wine.git/?a=commit;h=bd42c0416a5db8c607d7dd7bf1...
Author: Jacek Caban jacek@codeweavers.com Date: Fri Nov 16 14:39:16 2012 +0100
wininet: Fixed HTTP CONNECT secure connection.
---
dlls/wininet/http.c | 2 +- dlls/wininet/internet.h | 2 +- dlls/wininet/netconnection.c | 10 ++++++++-- 3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 1c24153..3eb0b8d 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -4743,7 +4743,7 @@ static DWORD open_http_connection(http_request_t *request, BOOL *reusing) if(request->proxy) res = HTTP_SecureProxyConnect(request); if(res == ERROR_SUCCESS) - res = NETCON_secure_connect(request->netconn); + res = NETCON_secure_connect(request->netconn, request->server); }
if(res != ERROR_SUCCESS) { diff --git a/dlls/wininet/internet.h b/dlls/wininet/internet.h index 3873855..1baaf2a 100644 --- a/dlls/wininet/internet.h +++ b/dlls/wininet/internet.h @@ -538,7 +538,7 @@ BOOL INTERNET_FindProxyForProtocol(LPCWSTR szProxy, LPCWSTR proto, WCHAR *foundP DWORD create_netconn(BOOL,server_t*,DWORD,BOOL,DWORD,netconn_t**) DECLSPEC_HIDDEN; void free_netconn(netconn_t*) DECLSPEC_HIDDEN; void NETCON_unload(void) DECLSPEC_HIDDEN; -DWORD NETCON_secure_connect(netconn_t *connection) DECLSPEC_HIDDEN; +DWORD NETCON_secure_connect(netconn_t*,server_t*) DECLSPEC_HIDDEN; DWORD NETCON_send(netconn_t *connection, const void *msg, size_t len, int flags, int *sent /* out */) DECLSPEC_HIDDEN; DWORD NETCON_recv(netconn_t *connection, void *buf, size_t len, int flags, diff --git a/dlls/wininet/netconnection.c b/dlls/wininet/netconnection.c index 2abb676..a792a92 100644 --- a/dlls/wininet/netconnection.c +++ b/dlls/wininet/netconnection.c @@ -707,7 +707,6 @@ DWORD create_netconn(BOOL useSSL, server_t *server, DWORD security_flags, BOOL m if(!netconn) return ERROR_OUTOFMEMORY;
- netconn->useSSL = useSSL; netconn->socketFD = -1; netconn->security_flags = security_flags | server->security_flags; netconn->mask_errors = mask_errors; @@ -903,7 +902,7 @@ fail: * NETCON_secure_connect * Initiates a secure connection over an existing plaintext connection. */ -DWORD NETCON_secure_connect(netconn_t *connection) +DWORD NETCON_secure_connect(netconn_t *connection, server_t *server) { DWORD res = ERROR_NOT_SUPPORTED; #ifdef SONAME_LIBSSL @@ -914,6 +913,13 @@ DWORD NETCON_secure_connect(netconn_t *connection) return ERROR_INTERNET_CANNOT_CONNECT; }
+ connection->useSSL = TRUE; + if(server != connection->server) { + server_release(connection->server); + server_addref(server); + connection->server = server; + } + /* connect with given TLS options */ res = netcon_secure_connect_setup(connection, get_tls_option()); if (res == ERROR_SUCCESS)