]> granicus.if.org Git - curl/commitdiff
doh: CURL_DISABLE_DOH
authorDaniel Stenberg <daniel@haxx.se>
Sun, 5 May 2019 15:08:21 +0000 (17:08 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 13 May 2019 06:17:09 +0000 (08:17 +0200)
lib/doh.c
lib/doh.h
lib/urldata.h

index b5327c4aef0021aaffc3a6e8c9c518f33471e50c..7d4a69d2fc0258b5ea1dd485b7bb457a37323d6a 100644 (file)
--- a/lib/doh.c
+++ b/lib/doh.c
@@ -22,6 +22,8 @@
 
 #include "curl_setup.h"
 
+#ifndef CURL_DISABLE_DOH
+
 #include "urldata.h"
 #include "curl_addrinfo.h"
 #include "doh.h"
@@ -960,3 +962,5 @@ CURLcode Curl_doh_is_resolved(struct connectdata *conn,
 
   return CURLE_OK;
 }
+
+#endif /* CURL_DISABLE_DOH */
index 83c79bc5df007631bafcca44326c223e46f4e9f6..34bfa6f2ba6f4b85d223630cd69294641dcce06a 100644 (file)
--- a/lib/doh.h
+++ b/lib/doh.h
@@ -7,7 +7,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 2018 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
@@ -25,6 +25,8 @@
 #include "urldata.h"
 #include "curl_addrinfo.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.
@@ -102,4 +104,10 @@ DOHcode doh_decode(unsigned char *doh,
                    struct dohentry *d);
 void de_cleanup(struct dohentry *d);
 #endif
+
+#else /* if DOH is disabled */
+#define Curl_doh(a,b,c,d) NULL
+#define Curl_doh_is_resolved(x,y) CURLE_COULDNT_RESOLVE_HOST
+#endif
+
 #endif /* HEADER_CURL_DOH_H */
index 608b675dfbd1a230e1d6b946e083332900c85af9..af745f9d10d362920d279fab60d46c75557efbc7 100644 (file)
@@ -604,7 +604,9 @@ struct SingleRequest {
   char *upload_fromhere;
   void *protop;       /* Allocated protocol-specific data. Each protocol
                          handler makes sure this points to data it needs. */
+#ifndef CURL_DISABLE_DOH
   struct dohdata doh; /* DoH specific data for this request */
+#endif
   bit header:1;       /* incoming data has HTTP header */
   bit content_range:1; /* set TRUE if Content-Range: was found */
   bit upload_done:1;  /* set to TRUE when doing chunked transfer-encoding