wininet(6/10): Use address length returned by GetAddress in NETCON_connect

Juan Lang juan.lang at gmail.com
Thu Jul 9 13:58:51 CDT 2009


--Juan
-------------- next part --------------
From afb242fe64f4fcf53ec4fa86449d35259d876d31 Mon Sep 17 00:00:00 2001
From: Juan Lang <juan.lang at gmail.com>
Date: Thu, 9 Jul 2009 11:30:59 -0700
Subject: [PATCH 10/14] Use address length returned by GetAddress in NETCON_connect

---
 dlls/wininet/http.c     |    7 +++----
 dlls/wininet/internet.h |    1 +
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index 4ff4be7..f7df3a9 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -1452,16 +1452,15 @@ static BOOL HTTP_ResolveName(LPWININETHTTPREQW lpwhr)
 {
     char szaddr[32];
     LPWININETHTTPSESSIONW lpwhs = lpwhr->lpHttpSession;
-    socklen_t sa_len;
 
     INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext,
                           INTERNET_STATUS_RESOLVING_NAME,
                           lpwhs->lpszServerName,
                           strlenW(lpwhs->lpszServerName)+1);
 
-    sa_len = sizeof(lpwhs->socketAddress);
+    lpwhs->sa_len = sizeof(lpwhs->socketAddress);
     if (!GetAddress(lpwhs->lpszServerName, lpwhs->nServerPort,
-                    (struct sockaddr *)&lpwhs->socketAddress, &sa_len))
+                    (struct sockaddr *)&lpwhs->socketAddress, &lpwhs->sa_len))
     {
         INTERNET_SetLastError(ERROR_INTERNET_NAME_NOT_RESOLVED);
         return FALSE;
@@ -4144,7 +4143,7 @@ static BOOL HTTP_OpenConnection(LPWININETHTTPREQW lpwhr)
     }
 
     if (!NETCON_connect(&lpwhr->netConnection, (struct sockaddr *)&lpwhs->socketAddress,
-                      sizeof(lpwhs->socketAddress)))
+                      lpwhs->sa_len))
        goto lend;
 
     if (lpwhr->hdr.dwFlags & INTERNET_FLAG_SECURE)
diff --git a/dlls/wininet/internet.h b/dlls/wininet/internet.h
index 53e9715..eae3423 100644
--- a/dlls/wininet/internet.h
+++ b/dlls/wininet/internet.h
@@ -166,6 +166,7 @@ typedef struct
     INTERNET_PORT nHostPort; /* the final destination port of the request */
     INTERNET_PORT nServerPort; /* the port of the server we directly connect to */
     struct sockaddr_in socketAddress;
+    socklen_t sa_len;
 } WININETHTTPSESSIONW, *LPWININETHTTPSESSIONW;
 
 #define HDR_ISREQUEST		0x0001
-- 
1.6.3.2


More information about the wine-patches mailing list