Jacek Caban : wininet: Renamed useSSL to secure and set it after secure connection is established .

Alexandre Julliard julliard at winehq.org
Fri Mar 1 12:42:24 CST 2013


Module: wine
Branch: master
Commit: c6ee6d6c9e1e200ed5155570dd368d9ca10ac7fe
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c6ee6d6c9e1e200ed5155570dd368d9ca10ac7fe

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Mar  1 11:15:53 2013 +0100

wininet: Renamed useSSL to secure and set it after secure connection is established.

---

 dlls/wininet/http.c          |    2 +-
 dlls/wininet/internet.h      |    2 +-
 dlls/wininet/netconnection.c |   18 +++++++++---------
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index 861288d..468fee6 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -1968,7 +1968,7 @@ static DWORD HTTPREQ_QueryOption(object_header_t *hdr, DWORD option, void *buffe
             info->Flags |= IDSI_FLAG_KEEP_ALIVE;
         if (req->proxy)
             info->Flags |= IDSI_FLAG_PROXY;
-        if (req->netconn->useSSL)
+        if (req->netconn->secure)
             info->Flags |= IDSI_FLAG_SECURE;
 
         return ERROR_SUCCESS;
diff --git a/dlls/wininet/internet.h b/dlls/wininet/internet.h
index 6d08db1..582599d 100644
--- a/dlls/wininet/internet.h
+++ b/dlls/wininet/internet.h
@@ -89,7 +89,7 @@ BOOL collect_connections(collect_type_t) DECLSPEC_HIDDEN;
 /* used for netconnection.c stuff */
 typedef struct
 {
-    BOOL useSSL;
+    BOOL secure;
     int socketFD;
     void *ssl_s;
     server_t *server;
diff --git a/dlls/wininet/netconnection.c b/dlls/wininet/netconnection.c
index 4869d60..dc47f2c 100644
--- a/dlls/wininet/netconnection.c
+++ b/dlls/wininet/netconnection.c
@@ -848,6 +848,7 @@ static DWORD netcon_secure_connect_setup(netconn_t *connection, long tls_option)
     }
 
     connection->ssl_s = ssl_s;
+    connection->secure = TRUE;
 
     bits = NETCON_GetCipherStrength(connection);
     if (bits >= 128)
@@ -879,21 +880,20 @@ fail:
 DWORD NETCON_secure_connect(netconn_t *connection, server_t *server)
 {
     DWORD res = ERROR_NOT_SUPPORTED;
-#ifdef SONAME_LIBSSL
+
     /* can't connect if we are already connected */
-    if (connection->ssl_s)
-    {
+    if(connection->secure) {
         ERR("already connected\n");
         return ERROR_INTERNET_CANNOT_CONNECT;
     }
 
-    connection->useSSL = TRUE;
     if(server != connection->server) {
         server_release(connection->server);
         server_addref(server);
         connection->server = server;
     }
 
+#ifdef SONAME_LIBSSL
     /* connect with given TLS options */
     res = netcon_secure_connect_setup(connection, get_tls_option());
     if (res == ERROR_SUCCESS)
@@ -926,7 +926,7 @@ DWORD NETCON_secure_connect(netconn_t *connection, server_t *server)
 DWORD NETCON_send(netconn_t *connection, const void *msg, size_t len, int flags,
 		int *sent /* out */)
 {
-    if (!connection->useSSL)
+    if(!connection->secure)
     {
 	*sent = send(connection->socketFD, msg, len, flags);
 	if (*sent == -1)
@@ -958,13 +958,13 @@ DWORD NETCON_send(netconn_t *connection, const void *msg, size_t len, int flags,
  * Basically calls 'recv()' unless we should use SSL
  * number of chars received is put in *recvd
  */
-DWORD NETCON_recv(netconn_t *connection, void *buf, size_t len, int flags,
-		int *recvd /* out */)
+DWORD NETCON_recv(netconn_t *connection, void *buf, size_t len, int flags, int *recvd)
 {
     *recvd = 0;
     if (!len)
         return ERROR_SUCCESS;
-    if (!connection->useSSL)
+
+    if (!connection->secure)
     {
 	*recvd = recv(connection->socketFD, buf, len, flags);
 	return *recvd == -1 ? sock_get_error(errno) :  ERROR_SUCCESS;
@@ -1000,7 +1000,7 @@ BOOL NETCON_query_data_available(netconn_t *connection, DWORD *available)
 {
     *available = 0;
 
-    if (!connection->useSSL)
+    if(!connection->secure)
     {
 #ifdef FIONREAD
         int unread;




More information about the wine-cvs mailing list