urldata: use a curl_prot_t type for storing protocol bits

This internal-use-only storage type can be bumped to a curl_off_t once
we need to use bit 32 as the previous 'unsigned int' can no longer hold
them all then.

The websocket protocols take bit 30 and 31 so they are the last ones
that fit within 32 bits - but cannot properly be exported through APIs
since those use *signed* 32 bit types (long) in places.

Closes #9481
This commit is contained in:
Daniel Stenberg 2022-09-12 09:57:01 +02:00
parent 0f52dd5fd5
commit cd5ca80f00
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
4 changed files with 38 additions and 19 deletions

View file

@ -625,7 +625,8 @@ void Curl_persistconninfo(struct Curl_easy *data, struct connectdata *conn,
else
data->info.conn_local_ip[0] = 0;
data->info.conn_scheme = conn->handler->scheme;
data->info.conn_protocol = conn->handler->protocol;
/* conn_protocol can only provide "old" protocols */
data->info.conn_protocol = (conn->handler->protocol) & CURLPROTO_MASK;
data->info.conn_primary_port = conn->port;
data->info.conn_remote_port = conn->remote_port;
data->info.conn_local_port = local_port;