Commit ad023172 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

wininet: lpvStatusInfo in INTERNET_STATUS_NAME_RESOLVED,

INTERNET_STATUS_CONNECTING_TO_SERVER and INTERNET_STATUS_CONNECTED_TO_SERVER should be strings, not sockaddr_in.
parent 545c4b7e
...@@ -32,6 +32,9 @@ ...@@ -32,6 +32,9 @@
#ifdef HAVE_SYS_SOCKET_H #ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h> # include <sys/socket.h>
#endif #endif
#ifdef HAVE_ARPA_INET_H
# include <arpa/inet.h>
#endif
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -985,6 +988,7 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs, ...@@ -985,6 +988,7 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs,
static const WCHAR szUrlForm[] = {'h','t','t','p',':','/','/','%','s',0}; static const WCHAR szUrlForm[] = {'h','t','t','p',':','/','/','%','s',0};
DWORD len; DWORD len;
LPHTTPHEADERW Host; LPHTTPHEADERW Host;
char szaddr[32];
TRACE("-->\n"); TRACE("-->\n");
...@@ -1140,10 +1144,11 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs, ...@@ -1140,10 +1144,11 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs,
goto lend; goto lend;
} }
inet_ntop(lpwhs->socketAddress.sin_family, &lpwhs->socketAddress.sin_addr,
szaddr, sizeof(szaddr));
INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext,
INTERNET_STATUS_NAME_RESOLVED, INTERNET_STATUS_NAME_RESOLVED,
&(lpwhs->socketAddress), szaddr, strlen(szaddr)+1);
sizeof(struct sockaddr_in));
lend: lend:
if( lpwhr ) if( lpwhr )
...@@ -1932,6 +1937,7 @@ static BOOL HTTP_HandleRedirect(LPWININETHTTPREQW lpwhr, LPCWSTR lpszUrl, LPCWST ...@@ -1932,6 +1937,7 @@ static BOOL HTTP_HandleRedirect(LPWININETHTTPREQW lpwhr, LPCWSTR lpszUrl, LPCWST
LPWININETHTTPSESSIONW lpwhs = (LPWININETHTTPSESSIONW) lpwhr->hdr.lpwhparent; LPWININETHTTPSESSIONW lpwhs = (LPWININETHTTPSESSIONW) lpwhr->hdr.lpwhparent;
LPWININETAPPINFOW hIC = (LPWININETAPPINFOW) lpwhs->hdr.lpwhparent; LPWININETAPPINFOW hIC = (LPWININETAPPINFOW) lpwhs->hdr.lpwhparent;
WCHAR path[2048]; WCHAR path[2048];
char szaddr[32];
if(lpszUrl[0]=='/') if(lpszUrl[0]=='/')
{ {
...@@ -2044,10 +2050,11 @@ static BOOL HTTP_HandleRedirect(LPWININETHTTPREQW lpwhr, LPCWSTR lpszUrl, LPCWST ...@@ -2044,10 +2050,11 @@ static BOOL HTTP_HandleRedirect(LPWININETHTTPREQW lpwhr, LPCWSTR lpszUrl, LPCWST
return FALSE; return FALSE;
} }
inet_ntop(lpwhs->socketAddress.sin_family, &lpwhs->socketAddress.sin_addr,
szaddr, sizeof(szaddr));
INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext,
INTERNET_STATUS_NAME_RESOLVED, INTERNET_STATUS_NAME_RESOLVED,
&(lpwhs->socketAddress), szaddr, strlen(szaddr)+1);
sizeof(struct sockaddr_in));
NETCON_close(&lpwhr->netConnection); NETCON_close(&lpwhr->netConnection);
NETCON_init(&lpwhr->netConnection,lpwhr->hdr.dwFlags & INTERNET_FLAG_SECURE); NETCON_init(&lpwhr->netConnection,lpwhr->hdr.dwFlags & INTERNET_FLAG_SECURE);
...@@ -2407,6 +2414,7 @@ static BOOL HTTP_OpenConnection(LPWININETHTTPREQW lpwhr) ...@@ -2407,6 +2414,7 @@ static BOOL HTTP_OpenConnection(LPWININETHTTPREQW lpwhr)
BOOL bSuccess = FALSE; BOOL bSuccess = FALSE;
LPWININETHTTPSESSIONW lpwhs; LPWININETHTTPSESSIONW lpwhs;
LPWININETAPPINFOW hIC = NULL; LPWININETAPPINFOW hIC = NULL;
char szaddr[32];
TRACE("-->\n"); TRACE("-->\n");
...@@ -2420,10 +2428,12 @@ static BOOL HTTP_OpenConnection(LPWININETHTTPREQW lpwhr) ...@@ -2420,10 +2428,12 @@ static BOOL HTTP_OpenConnection(LPWININETHTTPREQW lpwhr)
lpwhs = (LPWININETHTTPSESSIONW)lpwhr->hdr.lpwhparent; lpwhs = (LPWININETHTTPSESSIONW)lpwhr->hdr.lpwhparent;
hIC = (LPWININETAPPINFOW) lpwhs->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_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext,
INTERNET_STATUS_CONNECTING_TO_SERVER, INTERNET_STATUS_CONNECTING_TO_SERVER,
&(lpwhs->socketAddress), szaddr,
sizeof(struct sockaddr_in)); strlen(szaddr)+1);
if (!NETCON_create(&lpwhr->netConnection, lpwhs->socketAddress.sin_family, if (!NETCON_create(&lpwhr->netConnection, lpwhs->socketAddress.sin_family,
SOCK_STREAM, 0)) SOCK_STREAM, 0))
...@@ -2456,8 +2466,7 @@ static BOOL HTTP_OpenConnection(LPWININETHTTPREQW lpwhr) ...@@ -2456,8 +2466,7 @@ static BOOL HTTP_OpenConnection(LPWININETHTTPREQW lpwhr)
INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext,
INTERNET_STATUS_CONNECTED_TO_SERVER, INTERNET_STATUS_CONNECTED_TO_SERVER,
&(lpwhs->socketAddress), szaddr, strlen(szaddr)+1);
sizeof(struct sockaddr_in));
bSuccess = TRUE; bSuccess = TRUE;
......
...@@ -232,7 +232,14 @@ VOID INTERNET_SendCallback(LPWININETHANDLEHEADER hdr, DWORD dwContext, ...@@ -232,7 +232,14 @@ VOID INTERNET_SendCallback(LPWININETHANDLEHEADER hdr, DWORD dwContext,
} }
lpvNewInfo = lpvStatusInfo; 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) switch(dwInternetStatus)
{ {
case INTERNET_STATUS_RESOLVING_NAME: case INTERNET_STATUS_RESOLVING_NAME:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment