wininet: Directly return error status from NETCON_create.
This commit is contained in:
parent
510ed24f9a
commit
cff77d602c
@ -4314,6 +4314,7 @@ static BOOL HTTP_OpenConnection(http_request_t *lpwhr)
|
|||||||
appinfo_t *hIC = NULL;
|
appinfo_t *hIC = NULL;
|
||||||
char szaddr[INET6_ADDRSTRLEN];
|
char szaddr[INET6_ADDRSTRLEN];
|
||||||
const void *addr;
|
const void *addr;
|
||||||
|
DWORD res = ERROR_SUCCESS;
|
||||||
|
|
||||||
TRACE("-->\n");
|
TRACE("-->\n");
|
||||||
|
|
||||||
@ -4353,10 +4354,10 @@ static BOOL HTTP_OpenConnection(http_request_t *lpwhr)
|
|||||||
szaddr,
|
szaddr,
|
||||||
strlen(szaddr)+1);
|
strlen(szaddr)+1);
|
||||||
|
|
||||||
if (!NETCON_create(&lpwhr->netConnection, lpwhs->socketAddress.ss_family,
|
res = NETCON_create(&lpwhr->netConnection, lpwhs->socketAddress.ss_family, SOCK_STREAM, 0);
|
||||||
SOCK_STREAM, 0))
|
if (res != ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
WARN("Socket creation failed: %u\n", INTERNET_GetLastError());
|
WARN("Socket creation failed: %u\n", res);
|
||||||
goto lend;
|
goto lend;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4392,6 +4393,9 @@ lend:
|
|||||||
lpwhr->read_pos = lpwhr->read_size = 0;
|
lpwhr->read_pos = lpwhr->read_size = 0;
|
||||||
lpwhr->read_chunked = FALSE;
|
lpwhr->read_chunked = FALSE;
|
||||||
|
|
||||||
|
if(res != ERROR_SUCCESS)
|
||||||
|
INTERNET_SetLastError(res);
|
||||||
|
|
||||||
TRACE("%d <--\n", bSuccess);
|
TRACE("%d <--\n", bSuccess);
|
||||||
return bSuccess;
|
return bSuccess;
|
||||||
}
|
}
|
||||||
|
@ -430,7 +430,7 @@ VOID INTERNET_SendCallback(object_header_t *hdr, DWORD_PTR dwContext,
|
|||||||
BOOL NETCON_connected(WININET_NETCONNECTION *connection);
|
BOOL NETCON_connected(WININET_NETCONNECTION *connection);
|
||||||
BOOL NETCON_init(WININET_NETCONNECTION *connnection, BOOL useSSL);
|
BOOL NETCON_init(WININET_NETCONNECTION *connnection, BOOL useSSL);
|
||||||
void NETCON_unload(void);
|
void NETCON_unload(void);
|
||||||
BOOL NETCON_create(WININET_NETCONNECTION *connection, int domain,
|
DWORD NETCON_create(WININET_NETCONNECTION *connection, int domain,
|
||||||
int type, int protocol);
|
int type, int protocol);
|
||||||
BOOL NETCON_close(WININET_NETCONNECTION *connection);
|
BOOL NETCON_close(WININET_NETCONNECTION *connection);
|
||||||
BOOL NETCON_connect(WININET_NETCONNECTION *connection, const struct sockaddr *serv_addr,
|
BOOL NETCON_connect(WININET_NETCONNECTION *connection, const struct sockaddr *serv_addr,
|
||||||
|
@ -385,21 +385,19 @@ static int sock_get_error( int err )
|
|||||||
* NETCON_create
|
* NETCON_create
|
||||||
* Basically calls 'socket()'
|
* Basically calls 'socket()'
|
||||||
*/
|
*/
|
||||||
BOOL NETCON_create(WININET_NETCONNECTION *connection, int domain,
|
DWORD NETCON_create(WININET_NETCONNECTION *connection, int domain,
|
||||||
int type, int protocol)
|
int type, int protocol)
|
||||||
{
|
{
|
||||||
#ifdef SONAME_LIBSSL
|
#ifdef SONAME_LIBSSL
|
||||||
if (connection->useSSL)
|
if (connection->useSSL)
|
||||||
return FALSE;
|
return ERROR_NOT_SUPPORTED;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
connection->socketFD = socket(domain, type, protocol);
|
connection->socketFD = socket(domain, type, protocol);
|
||||||
if (connection->socketFD == -1)
|
if (connection->socketFD == -1)
|
||||||
{
|
return sock_get_error(errno);
|
||||||
INTERNET_SetLastError(sock_get_error(errno));
|
|
||||||
return FALSE;
|
return ERROR_SUCCESS;
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
|
Loading…
x
Reference in New Issue
Block a user