]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
doh: move doh related struct definitions to doh.h
authorDaniel Stenberg <daniel@haxx.se>
Sun, 17 Jul 2022 21:58:43 +0000 (23:58 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 18 Jul 2022 09:55:26 +0000 (11:55 +0200)
and make 'dnstype' in 'struct dnsprobe' use the DNStype to fix the icc compiler warning:

  doh.c(924): error #188: enumerated type mixed with another type

Reported-by: Matthew Thompson
Ref #9156
Closes #9174

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

index f8b643535093ea6cf8afb8bfea4ba388289a8f19..678e807fe4800639a97eebd8a864ae4d0a30489f 100644 (file)
--- a/lib/doh.h
+++ b/lib/doh.h
 
 #ifndef CURL_DISABLE_DOH
 
-/*
- * Curl_doh() resolve a name using DoH (DNS-over-HTTPS). It resolves a name
- * and returns a 'Curl_addrinfo *' with the address information.
- */
-
-struct Curl_addrinfo *Curl_doh(struct Curl_easy *data,
-                               const char *hostname,
-                               int port,
-                               int *waitp);
-
-CURLcode Curl_doh_is_resolved(struct Curl_easy *data,
-                              struct Curl_dns_entry **dns);
-
-int Curl_doh_getsock(struct connectdata *conn, curl_socket_t *socks);
-
 typedef enum {
   DOH_OK,
   DOH_DNS_BAD_LABEL,    /* 1 */
@@ -69,6 +54,38 @@ typedef enum {
   DNS_TYPE_DNAME = 39           /* RFC6672 */
 } DNStype;
 
+/* one of these for each DoH request */
+struct dnsprobe {
+  CURL *easy;
+  DNStype dnstype;
+  unsigned char dohbuffer[512];
+  size_t dohlen;
+  struct dynbuf serverdoh;
+};
+
+struct dohdata {
+  struct curl_slist *headers;
+  struct dnsprobe probe[DOH_PROBE_SLOTS];
+  unsigned int pending; /* still outstanding requests */
+  int port;
+  const char *host;
+};
+
+/*
+ * Curl_doh() resolve a name using DoH (DNS-over-HTTPS). It resolves a name
+ * and returns a 'Curl_addrinfo *' with the address information.
+ */
+
+struct Curl_addrinfo *Curl_doh(struct Curl_easy *data,
+                               const char *hostname,
+                               int port,
+                               int *waitp);
+
+CURLcode Curl_doh_is_resolved(struct Curl_easy *data,
+                              struct Curl_dns_entry **dns);
+
+int Curl_doh_getsock(struct connectdata *conn, curl_socket_t *socks);
+
 #define DOH_MAX_ADDR 24
 #define DOH_MAX_CNAME 4
 
index 287efd5c1c88afa70a3dab6756391732b970678e..7e9924d2594df4df81747097550326955edade77 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -77,6 +77,7 @@
 bool curl_win32_idn_to_ascii(const char *in, char **out);
 #endif  /* USE_LIBIDN2 */
 
+#include "doh.h"
 #include "urldata.h"
 #include "netrc.h"
 
index 826d3190b39956ef57b23e30e9f930a4010d6407..577993c20f25215bf69121245ef2bae2f83b9dd8 100644 (file)
@@ -598,23 +598,6 @@ enum doh_slots {
   DOH_PROBE_SLOTS
 };
 
-/* one of these for each DoH request */
-struct dnsprobe {
-  CURL *easy;
-  int dnstype;
-  unsigned char dohbuffer[512];
-  size_t dohlen;
-  struct dynbuf serverdoh;
-};
-
-struct dohdata {
-  struct curl_slist *headers;
-  struct dnsprobe probe[DOH_PROBE_SLOTS];
-  unsigned int pending; /* still outstanding requests */
-  int port;
-  const char *host;
-};
-
 /*
  * Request specific data in the easy handle (Curl_easy).  Previously,
  * these members were on the connectdata struct but since a conn struct may