urldata: move the 'internal' boolean to the state struct

... where all the other state bits for the easy handles live.

Closes #12165
This commit is contained in:
Daniel Stenberg 2023-10-20 11:33:08 +02:00
parent b0bee93dfe
commit fc077bc786
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
5 changed files with 7 additions and 8 deletions

View File

@ -107,7 +107,7 @@ int Curl_conncache_init(struct conncache *connc, int size)
connc->closure_handle = curl_easy_init();
if(!connc->closure_handle)
return 1; /* bad */
connc->closure_handle->internal = true;
connc->closure_handle->state.internal = true;
Curl_hash_init(&connc->hash, size, Curl_hash_str,
Curl_str_key_compare, free_bundle_hash_entry);

View File

@ -242,7 +242,7 @@ static CURLcode dohprobe(struct Curl_easy *data,
/* pass in the struct pointer via a local variable to please coverity and
the gcc typecheck helpers */
struct dynbuf *resp = &p->serverdoh;
doh->internal = true;
doh->state.internal = true;
ERROR_CHECK_SETOPT(CURLOPT_URL, url);
ERROR_CHECK_SETOPT(CURLOPT_DEFAULT_PROTOCOL, "https");
ERROR_CHECK_SETOPT(CURLOPT_WRITEFUNCTION, doh_write_cb);

View File

@ -3770,7 +3770,7 @@ struct Curl_easy **curl_multi_get_handles(struct Curl_multi *multi)
struct Curl_easy *e = multi->easyp;
while(e) {
DEBUGASSERT(i < multi->num_easy);
if(!e->internal)
if(!e->state.internal)
a[i++] = e;
e = e->next;
}

View File

@ -363,7 +363,7 @@ CURLcode Curl_close(struct Curl_easy **datap)
/* Detach connection if any is left. This should not be normal, but can be
the case for example with CONNECT_ONLY + recv/send (test 556) */
Curl_detach_connection(data);
if(!data->internal) {
if(!data->state.internal) {
if(data->multi)
/* This handle is still part of a multi handle, take care of this first
and detach this handle from there. */

View File

@ -1498,6 +1498,9 @@ struct UrlState {
though it will be discarded. We must call the data
rewind callback before trying to send again. */
BIT(upload); /* upload request */
BIT(internal); /* internal: true if this easy handle was created for
internal use and the user does not have ownership of the
handle. */
};
/*
@ -2013,10 +2016,6 @@ struct Curl_easy {
#ifdef USE_HYPER
struct hyptransfer hyp;
#endif
/* internal: true if this easy handle was created for internal use and the
user does not have ownership of the handle. */
bool internal;
};
#define LIBCURL_NAME "libcurl"