Jacek Caban : wininet: lpvStatusInfo in INTERNET_STATUS_NAME_RESOLVED,

Alexandre Julliard julliard at wine.codeweavers.com
Thu Jan 5 10:54:00 CST 2006


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Jan  5 14:37:06 2006 +0100

wininet: lpvStatusInfo in INTERNET_STATUS_NAME_RESOLVED,
INTERNET_STATUS_CONNECTING_TO_SERVER and
INTERNET_STATUS_CONNECTED_TO_SERVER should be strings, not
sockaddr_in.

---

 dlls/wininet/http.c    |   25 +++++++++++++++++--------
 dlls/wininet/utility.c |    9 ++++++++-
 2 files changed, 25 insertions(+), 9 deletions(-)

diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index aa0b83f..ee78f24 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -32,6 +32,9 @@
 #ifdef HAVE_SYS_SOCKET_H
 # include <sys/socket.h>
 #endif
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -985,6 +988,7 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(L
     static const WCHAR szUrlForm[] = {'h','t','t','p',':','/','/','%','s',0};
     DWORD len;
     LPHTTPHEADERW Host;
+    char szaddr[32];
 
     TRACE("-->\n");
 
@@ -1140,10 +1144,11 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(L
         goto lend;
     }
 
+    inet_ntop(lpwhs->socketAddress.sin_family, &lpwhs->socketAddress.sin_addr,
+              szaddr, sizeof(szaddr));
     INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext,
                           INTERNET_STATUS_NAME_RESOLVED,
-                          &(lpwhs->socketAddress),
-                          sizeof(struct sockaddr_in));
+                          szaddr, strlen(szaddr)+1);
 
 lend:
     if( lpwhr )
@@ -1932,6 +1937,7 @@ static BOOL HTTP_HandleRedirect(LPWININE
     LPWININETHTTPSESSIONW lpwhs = (LPWININETHTTPSESSIONW) lpwhr->hdr.lpwhparent;
     LPWININETAPPINFOW hIC = (LPWININETAPPINFOW) lpwhs->hdr.lpwhparent;
     WCHAR path[2048];
+    char szaddr[32];
 
     if(lpszUrl[0]=='/')
     {
@@ -2044,10 +2050,11 @@ static BOOL HTTP_HandleRedirect(LPWININE
             return FALSE;
         }
 
+        inet_ntop(lpwhs->socketAddress.sin_family, &lpwhs->socketAddress.sin_addr,
+              szaddr, sizeof(szaddr));
         INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext,
                               INTERNET_STATUS_NAME_RESOLVED,
-                              &(lpwhs->socketAddress),
-                              sizeof(struct sockaddr_in));
+                              szaddr, strlen(szaddr)+1);
 
         NETCON_close(&lpwhr->netConnection);
         NETCON_init(&lpwhr->netConnection,lpwhr->hdr.dwFlags & INTERNET_FLAG_SECURE);
@@ -2407,6 +2414,7 @@ static BOOL HTTP_OpenConnection(LPWININE
     BOOL bSuccess = FALSE;
     LPWININETHTTPSESSIONW lpwhs;
     LPWININETAPPINFOW hIC = NULL;
+    char szaddr[32];
 
     TRACE("-->\n");
 
@@ -2420,10 +2428,12 @@ static BOOL HTTP_OpenConnection(LPWININE
     lpwhs = (LPWININETHTTPSESSIONW)lpwhr->hdr.lpwhparent;
 
     hIC = (LPWININETAPPINFOW) lpwhs->hdr.lpwhparent;
+    inet_ntop(lpwhs->socketAddress.sin_family, &lpwhs->socketAddress.sin_addr,
+              szaddr, sizeof(szaddr));
     INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext,
                           INTERNET_STATUS_CONNECTING_TO_SERVER,
-                          &(lpwhs->socketAddress),
-                          sizeof(struct sockaddr_in));
+                          szaddr,
+                          strlen(szaddr)+1);
 
     if (!NETCON_create(&lpwhr->netConnection, lpwhs->socketAddress.sin_family,
                          SOCK_STREAM, 0))
@@ -2456,8 +2466,7 @@ static BOOL HTTP_OpenConnection(LPWININE
 
     INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext,
                           INTERNET_STATUS_CONNECTED_TO_SERVER,
-                          &(lpwhs->socketAddress),
-                          sizeof(struct sockaddr_in));
+                          szaddr, strlen(szaddr)+1);
 
     bSuccess = TRUE;
 
diff --git a/dlls/wininet/utility.c b/dlls/wininet/utility.c
index 490ea80..e6501b0 100644
--- a/dlls/wininet/utility.c
+++ b/dlls/wininet/utility.c
@@ -232,7 +232,14 @@ VOID INTERNET_SendCallback(LPWININETHAND
     }
 
     lpvNewInfo = lpvStatusInfo;
-    if(!(hdr->dwInternalFlags & INET_CALLBACKW)) {
+    if(hdr->dwInternalFlags & INET_CALLBACKW) {
+        switch(dwInternetStatus) {
+        case INTERNET_STATUS_NAME_RESOLVED:
+        case INTERNET_STATUS_CONNECTING_TO_SERVER:
+        case INTERNET_STATUS_CONNECTED_TO_SERVER:
+            lpvNewInfo = WININET_strdup_AtoW(lpvStatusInfo);
+        }
+    }else {
         switch(dwInternetStatus)
         {
         case INTERNET_STATUS_RESOLVING_NAME:




More information about the wine-cvs mailing list