urldata: reduce two long struct fields to unsigned short

Closes #18173
This commit is contained in:
Daniel Stenberg 2025-08-04 22:25:29 +02:00
parent df2b4ccc22
commit 1f34125141
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 9 additions and 7 deletions

View file

@ -4785,7 +4785,7 @@ static CURLcode cr_exp100_read(struct Curl_easy *data,
/* We are now waiting for a reply from the server or
* a timeout on our side IFF the request has been fully sent. */
DEBUGF(infof(data, "cr_exp100_read, start AWAITING_CONTINUE, "
"timeout %ldms", data->set.expect_100_timeout));
"timeout %dms", data->set.expect_100_timeout));
ctx->state = EXP100_AWAITING_CONTINUE;
ctx->start = curlx_now();
Curl_expire(data, data->set.expect_100_timeout, EXPIRE_100_TIMEOUT);

View file

@ -919,7 +919,7 @@ static CURLcode setopt_long(struct Curl_easy *data, CURLoption option,
arg = 512;
else if(arg > TFTP_BLKSIZE_MAX)
arg = TFTP_BLKSIZE_MAX;
s->tftp_blksize = arg;
s->tftp_blksize = (unsigned short)arg;
break;
#endif
#ifndef CURL_DISABLE_NETRC
@ -1027,7 +1027,9 @@ static CURLcode setopt_long(struct Curl_easy *data, CURLoption option,
*/
if(arg < 0)
return CURLE_BAD_FUNCTION_ARGUMENT;
s->expect_100_timeout = arg;
if(arg > 0xffff)
arg = 0xffff;
s->expect_100_timeout = (unsigned short)arg;
break;
#endif /* ! CURL_DISABLE_HTTP */

View file

@ -1388,9 +1388,6 @@ struct UserDefined {
is to be reused */
timediff_t conn_max_age_ms; /* max time since creation to allow a
connection that is to be reused */
#ifndef CURL_DISABLE_TFTP
long tftp_blksize; /* in bytes, 0 means use default */
#endif
curl_off_t filesize; /* size of file to upload, -1 means unknown */
long low_speed_limit; /* bytes/second */
long low_speed_time; /* number of seconds */
@ -1485,7 +1482,6 @@ struct UserDefined {
int tcp_keepintvl; /* seconds between TCP keepalive probes */
int tcp_keepcnt; /* maximum number of keepalive probes */
long expect_100_timeout; /* in milliseconds */
#if defined(USE_HTTP2) || defined(USE_HTTP3)
struct Curl_data_priority priority;
#endif
@ -1505,6 +1501,7 @@ struct UserDefined {
#ifdef USE_ECH
int tls_ech; /* TLS ECH configuration */
#endif
unsigned short expect_100_timeout; /* in milliseconds */
unsigned short use_port; /* which port to use (when not using default) */
#ifndef CURL_DISABLE_BINDLOCAL
unsigned short localport; /* local port number to bind to */
@ -1512,6 +1509,9 @@ struct UserDefined {
in case the 'localport' one cannot be
bind()ed */
#endif
#ifndef CURL_DISABLE_TFTP
unsigned short tftp_blksize; /* in bytes, 0 means use default */
#endif
#ifndef CURL_DISABLE_NETRC
unsigned char use_netrc; /* enum CURL_NETRC_OPTION values */
#endif