urldata: convert 'long' fields to fixed variable types

Makes sure they work identically cross-platform, as long varies in size
between Windows vs non-Windows. Makes Curl_easy 16 bytes smaller on 64
bit Linux.

This reduces support for the RTSP cseq counters to 32 bit (down from 63
bit previously on 64 bit non-Windows), but it is probably safe.
Implementations probably rarely support anything above 32 bits anyway
and this is how curl has worked on Windows since always.

There is now only one 'long' left in urldata.h (in the ssl_config_data
struct). That field, certverifyresult, is used to store the response
code from TLS backend code and in the OpenSSL case that function returns
an actual 'long'.

Closes #20227
This commit is contained in:
Daniel Stenberg 2026-01-08 23:57:58 +01:00
parent 3402036e1a
commit d881b91133
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
5 changed files with 42 additions and 35 deletions

View file

@ -152,11 +152,9 @@ UNITTEST CURLcode pgrs_speedcheck(struct Curl_easy *data,
if(howlong >= data->set.low_speed_time * 1000) {
/* too long */
failf(data,
"Operation too slow. "
"Less than %ld bytes/sec transferred the last %ld seconds",
data->set.low_speed_limit,
data->set.low_speed_time);
failf(data, "Operation too slow. Less than %" FMT_OFF_T
" bytes/sec transferred the last %u seconds",
data->set.low_speed_limit, data->set.low_speed_time);
return CURLE_OPERATION_TIMEDOUT;
}
}