Commit 848cd8a2 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wininet: Add support for setting and retrieving the connect timeout.

parent 72273a07
......@@ -2151,6 +2151,13 @@ static DWORD HTTPREQ_QueryOption(object_header_t *hdr, DWORD option, void *buffe
return ERROR_SUCCESS;
}
}
case INTERNET_OPTION_CONNECT_TIMEOUT:
if (*size < sizeof(DWORD))
return ERROR_INSUFFICIENT_BUFFER;
*size = sizeof(DWORD);
*(DWORD *)buffer = req->connect_timeout;
return ERROR_SUCCESS;
}
return INET_QueryOption(hdr, option, buffer, size, unicode);
......@@ -2174,6 +2181,13 @@ static DWORD HTTPREQ_SetOption(object_header_t *hdr, DWORD option, void *buffer,
req->netconn->security_flags = flags;
return ERROR_SUCCESS;
}
case INTERNET_OPTION_CONNECT_TIMEOUT:
if (size != sizeof(DWORD))
return ERROR_INVALID_PARAMETER;
req->connect_timeout = *(DWORD *)buffer;
return ERROR_SUCCESS;
case INTERNET_OPTION_SEND_TIMEOUT:
case INTERNET_OPTION_RECEIVE_TIMEOUT:
TRACE("INTERNET_OPTION_SEND/RECEIVE_TIMEOUT\n");
......@@ -5438,6 +5452,8 @@ static void HTTPSESSION_Destroy(object_header_t *hdr)
static DWORD HTTPSESSION_QueryOption(object_header_t *hdr, DWORD option, void *buffer, DWORD *size, BOOL unicode)
{
http_session_t *ses = (http_session_t *)hdr;
switch(option) {
case INTERNET_OPTION_HANDLE_TYPE:
TRACE("INTERNET_OPTION_HANDLE_TYPE\n");
......@@ -5448,6 +5464,15 @@ static DWORD HTTPSESSION_QueryOption(object_header_t *hdr, DWORD option, void *b
*size = sizeof(DWORD);
*(DWORD*)buffer = INTERNET_HANDLE_TYPE_CONNECT_HTTP;
return ERROR_SUCCESS;
case INTERNET_OPTION_CONNECT_TIMEOUT:
TRACE("INTERNET_OPTION_CONNECT_TIMEOUT\n");
if (*size < sizeof(DWORD))
return ERROR_INSUFFICIENT_BUFFER;
*size = sizeof(DWORD);
*(DWORD *)buffer = ses->connect_timeout;
return ERROR_SUCCESS;
}
return INET_QueryOption(hdr, option, buffer, size, unicode);
......@@ -5470,6 +5495,11 @@ static DWORD HTTPSESSION_SetOption(object_header_t *hdr, DWORD option, void *buf
if (!(ses->password = heap_strdupW(buffer))) return ERROR_OUTOFMEMORY;
return ERROR_SUCCESS;
}
case INTERNET_OPTION_CONNECT_TIMEOUT:
{
ses->connect_timeout = *(DWORD *)buffer;
return ERROR_SUCCESS;
}
default: break;
}
......
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