summaryrefslogtreecommitdiff
path: root/lib/doh.c
diff options
context:
space:
mode:
authorMarcel Raad <Marcel.Raad@teamviewer.com>2019-05-11 21:42:48 +0200
committerMarcel Raad <Marcel.Raad@teamviewer.com>2019-05-20 08:51:11 +0200
commit10db3ef21eef1c7a1727579952a81ced2f4afc8b (patch)
tree57129a847b5913959063a60290201b1f52482fee /lib/doh.c
parent27af2ec219244bef24e6d11649d41aad3668da45 (diff)
downloadcurl-10db3ef21eef1c7a1727579952a81ced2f4afc8b.tar.gz
lib: reduce variable scopes
Fixes Codacy/CppCheck warnings. Closes https://github.com/curl/curl/pull/3872
Diffstat (limited to 'lib/doh.c')
-rw-r--r--lib/doh.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/doh.c b/lib/doh.c
index 7d4a69d2f..6d1f3303b 100644
--- a/lib/doh.c
+++ b/lib/doh.c
@@ -584,7 +584,6 @@ UNITTEST DOHcode doh_decode(unsigned char *doh,
unsigned short qdcount;
unsigned short ancount;
unsigned short type = 0;
- unsigned short class;
unsigned short rdlength;
unsigned short nscount;
unsigned short arcount;
@@ -612,6 +611,7 @@ UNITTEST DOHcode doh_decode(unsigned char *doh,
ancount = get16bit(doh, 6);
while(ancount) {
+ unsigned short class;
unsigned int ttl;
rc = skipqname(doh, dohlen, &index);
@@ -896,8 +896,6 @@ CURLcode Curl_doh_is_resolved(struct connectdata *conn,
DOHcode rc;
DOHcode rc2;
struct dohentry de;
- struct Curl_dns_entry *dns;
- struct Curl_addrinfo *ai;
/* remove DOH handles from multi handle and close them */
curl_multi_remove_handle(data->multi, data->req.doh.probe[0].easy);
Curl_close(data->req.doh.probe[0].easy);
@@ -927,6 +925,9 @@ CURLcode Curl_doh_is_resolved(struct connectdata *conn,
data->req.doh.host);
}
if(!rc || !rc2) {
+ struct Curl_dns_entry *dns;
+ struct Curl_addrinfo *ai;
+
infof(data, "DOH Host name: %s\n", data->req.doh.host);
showdoh(data, &de);