Commit deabdca6 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

wininet: Use length reported by GetAddress in FTP_Connect.

parent 33d09e73
...@@ -2458,9 +2458,9 @@ HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName, ...@@ -2458,9 +2458,9 @@ HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName,
} }
SendAsyncCallback(&hIC->hdr, dwContext, INTERNET_STATUS_CONNECTING_TO_SERVER, SendAsyncCallback(&hIC->hdr, dwContext, INTERNET_STATUS_CONNECTING_TO_SERVER,
&socketAddr, sizeof(struct sockaddr_in)); &socketAddr, sock_namelen);
if (connect(nsocket, (struct sockaddr *)&socketAddr, sizeof(socketAddr)) < 0) if (connect(nsocket, (struct sockaddr *)&socketAddr, sock_namelen) < 0)
{ {
ERR("Unable to connect (%s)\n", strerror(errno)); ERR("Unable to connect (%s)\n", strerror(errno));
INTERNET_SetLastError(ERROR_INTERNET_CANNOT_CONNECT); INTERNET_SetLastError(ERROR_INTERNET_CANNOT_CONNECT);
...@@ -2471,7 +2471,7 @@ HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName, ...@@ -2471,7 +2471,7 @@ HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName,
TRACE("Connected to server\n"); TRACE("Connected to server\n");
lpwfs->sndSocket = nsocket; lpwfs->sndSocket = nsocket;
SendAsyncCallback(&hIC->hdr, dwContext, INTERNET_STATUS_CONNECTED_TO_SERVER, SendAsyncCallback(&hIC->hdr, dwContext, INTERNET_STATUS_CONNECTED_TO_SERVER,
&socketAddr, sizeof(struct sockaddr_in)); &socketAddr, sock_namelen);
sock_namelen = sizeof(lpwfs->socketAddress); sock_namelen = sizeof(lpwfs->socketAddress);
getsockname(nsocket, (struct sockaddr *) &lpwfs->socketAddress, &sock_namelen); getsockname(nsocket, (struct sockaddr *) &lpwfs->socketAddress, &sock_namelen);
......
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