From: Daniel Stenberg Date: Fri, 20 Oct 2023 09:33:08 +0000 (+0200) Subject: urldata: move the 'internal' boolean to the state struct X-Git-Tag: curl-8_5_0~226 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fc077bc786c820abb1be277c01603034f4174dd4;p=thirdparty%2Fcurl.git urldata: move the 'internal' boolean to the state struct ... where all the other state bits for the easy handles live. Closes #12165 --- diff --git a/lib/conncache.c b/lib/conncache.c index 93d87686c8..75cd4db45a 100644 --- a/lib/conncache.c +++ b/lib/conncache.c @@ -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); diff --git a/lib/doh.c b/lib/doh.c index 9be32d3bc5..4750959855 100644 --- a/lib/doh.c +++ b/lib/doh.c @@ -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); diff --git a/lib/multi.c b/lib/multi.c index 3f51f776eb..b9d8363902 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -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; } diff --git a/lib/url.c b/lib/url.c index e2d97e21d6..0eb14263a1 100644 --- a/lib/url.c +++ b/lib/url.c @@ -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. */ diff --git a/lib/urldata.h b/lib/urldata.h index dff26e6b4b..03c265f162 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -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"