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

wininet: Directly return error status from NETCON_connect.

parent cff77d60
......@@ -4361,8 +4361,9 @@ static BOOL HTTP_OpenConnection(http_request_t *lpwhr)
goto lend;
}
if (!NETCON_connect(&lpwhr->netConnection, (struct sockaddr *)&lpwhs->socketAddress,
lpwhs->sa_len))
res = NETCON_connect(&lpwhr->netConnection, (struct sockaddr *)&lpwhs->socketAddress,
lpwhs->sa_len);
if(res != ERROR_SUCCESS)
goto lend;
if (lpwhr->hdr.dwFlags & INTERNET_FLAG_SECURE)
......
......@@ -433,7 +433,7 @@ void NETCON_unload(void);
DWORD NETCON_create(WININET_NETCONNECTION *connection, int domain,
int type, int protocol);
BOOL NETCON_close(WININET_NETCONNECTION *connection);
BOOL NETCON_connect(WININET_NETCONNECTION *connection, const struct sockaddr *serv_addr,
DWORD NETCON_connect(WININET_NETCONNECTION *connection, const struct sockaddr *serv_addr,
unsigned int addrlen);
BOOL NETCON_secure_connect(WININET_NETCONNECTION *connection, LPCWSTR hostname);
BOOL NETCON_send(WININET_NETCONNECTION *connection, const void *msg, size_t len, int flags,
......
......@@ -532,25 +532,22 @@ fail:
* NETCON_connect
* Connects to the specified address.
*/
BOOL NETCON_connect(WININET_NETCONNECTION *connection, const struct sockaddr *serv_addr,
DWORD NETCON_connect(WININET_NETCONNECTION *connection, const struct sockaddr *serv_addr,
unsigned int addrlen)
{
int result;
if (!NETCON_connected(connection)) return FALSE;
result = connect(connection->socketFD, serv_addr, addrlen);
if (result == -1)
{
WARN("Unable to connect to host (%s)\n", strerror(errno));
INTERNET_SetLastError(sock_get_error(errno));
closesocket(connection->socketFD);
connection->socketFD = -1;
return FALSE;
return sock_get_error(errno);
}
return TRUE;
return ERROR_SUCCESS;
}
/******************************************************************************
......
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