lib: add CURLINFO_CONN_ID and CURLINFO_XFER_ID

- add an `id` long to Curl_easy, -1 on init
- once added to a multi (or its own multi), it gets
  a non-negative number assigned by the connection cache
- `id` is unique among all transfers using the same
  cache until reaching LONG_MAX where it will wrap
  around. So, not unique eternally.
- CURLINFO_CONN_ID returns the connection id attached to
  data or, if none present, data->state.lastconnect_id
- variables and type declared in tool for write out

Closes #11185
This commit is contained in:
Stefan Eissing 2023-05-23 12:48:58 +02:00 committed by Daniel Stenberg
parent fdda99c6ee
commit e024d5665d
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
31 changed files with 252 additions and 94 deletions

View file

@ -474,7 +474,7 @@ static CURLcode readwrite_data(struct Curl_easy *data,
else {
/* read nothing but since we wanted nothing we consider this an OK
situation to proceed from */
DEBUGF(infof(data, DMSG(data, "readwrite_data: we're done")));
DEBUGF(infof(data, "readwrite_data: we're done"));
nread = 0;
}
@ -771,7 +771,7 @@ static CURLcode readwrite_data(struct Curl_easy *data,
out:
if(result)
DEBUGF(infof(data, DMSG(data, "readwrite_data() -> %d"), result));
DEBUGF(infof(data, "readwrite_data() -> %d", result));
return result;
}
@ -1236,7 +1236,7 @@ CURLcode Curl_readwrite(struct connectdata *conn,
*done = (0 == (k->keepon&(KEEP_RECVBITS|KEEP_SENDBITS))) ? TRUE : FALSE;
out:
if(result)
DEBUGF(infof(data, DMSG(data, "Curl_readwrite() -> %d"), result));
DEBUGF(infof(data, "Curl_readwrite() -> %d", result));
return result;
}