mirror of
https://github.com/curl/curl.git
synced 2026-08-03 00:20:36 +03:00
CURLOPT_SERVER_RESPONSE_TIMEOUT_MS: add
Proposed-by: Yifei Kong Ref: https://curl.se/mail/lib-2023-11/0023.html Closes #12369
This commit is contained in:
parent
0923012758
commit
dd29622f32
7 changed files with 97 additions and 1 deletions
|
|
@ -274,6 +274,8 @@ struct curl_easyoption Curl_easyopts[] = {
|
|||
{"SEEKFUNCTION", CURLOPT_SEEKFUNCTION, CURLOT_FUNCTION, 0},
|
||||
{"SERVER_RESPONSE_TIMEOUT", CURLOPT_SERVER_RESPONSE_TIMEOUT,
|
||||
CURLOT_LONG, 0},
|
||||
{"SERVER_RESPONSE_TIMEOUT_MS", CURLOPT_SERVER_RESPONSE_TIMEOUT_MS,
|
||||
CURLOT_LONG, 0},
|
||||
{"SERVICE_NAME", CURLOPT_SERVICE_NAME, CURLOT_STRING, 0},
|
||||
{"SHARE", CURLOPT_SHARE, CURLOT_OBJECT, 0},
|
||||
{"SOCKOPTDATA", CURLOPT_SOCKOPTDATA, CURLOT_CBPTR, 0},
|
||||
|
|
@ -373,6 +375,6 @@ struct curl_easyoption Curl_easyopts[] = {
|
|||
*/
|
||||
int Curl_easyopts_check(void)
|
||||
{
|
||||
return ((CURLOPT_LASTENTRY%10000) != (323 + 1));
|
||||
return ((CURLOPT_LASTENTRY%10000) != (324 + 1));
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
11
lib/setopt.c
11
lib/setopt.c
|
|
@ -366,6 +366,17 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
|
|||
else
|
||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||
break;
|
||||
case CURLOPT_SERVER_RESPONSE_TIMEOUT_MS:
|
||||
/*
|
||||
* Option that specifies how quickly a server response must be obtained
|
||||
* before it is considered failure. For pingpong protocols.
|
||||
*/
|
||||
arg = va_arg(param, long);
|
||||
if((arg >= 0) && (arg <= INT_MAX))
|
||||
data->set.server_response_timeout = (unsigned int)arg;
|
||||
else
|
||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||
break;
|
||||
#ifndef CURL_DISABLE_TFTP
|
||||
case CURLOPT_TFTP_NO_OPTIONS:
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue