]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
urldata: move the 'internal' boolean to the state struct
authorDaniel Stenberg <daniel@haxx.se>
Fri, 20 Oct 2023 09:33:08 +0000 (11:33 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 20 Oct 2023 14:59:52 +0000 (16:59 +0200)
... where all the other state bits for the easy handles live.

Closes #12165

lib/conncache.c
lib/doh.c
lib/multi.c
lib/url.c
lib/urldata.h

index 93d87686c8e212466be541ffaef1a20ae1d317b3..75cd4db45a513ac6c25f785ac6fd2f5b12822bc1 100644 (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);
index 9be32d3bc50a9a28abbbfe679e3635618db4919a..475095985570e2bd50683ae56ac6a983a27f9b2b 100644 (file)
--- 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);
index 3f51f776ebe347c357012c80be27b9125facd1c0..b9d8363902843f13344ab67a53cc1a6360fc68c9 100644 (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;
     }
index e2d97e21d6f9274494ab3c04191e197e2de99dc6..0eb14263a13a4a70fbf524e522d8617175cc84aa 100644 (file)
--- 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. */
index dff26e6b4bd1a28602479a2ad72905be5a4c9a52..03c265f16286b53a0cd9fdaabef0ade95acc59ae 100644 (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"