mirror of
https://github.com/curl/curl.git
synced 2025-02-17 14:59:45 +08:00
parent
c72dd0bb14
commit
24606191f8
14
lib/doh.c
14
lib/doh.c
@ -542,7 +542,7 @@ static unsigned int doh_get32bit(const unsigned char *doh, unsigned int index)
|
|||||||
((unsigned)doh[2] << 8) | doh[3];
|
((unsigned)doh[2] << 8) | doh[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
static DOHcode doh_store_a(const unsigned char *doh, int index,
|
static void doh_store_a(const unsigned char *doh, int index,
|
||||||
struct dohentry *d)
|
struct dohentry *d)
|
||||||
{
|
{
|
||||||
/* silently ignore addresses over the limit */
|
/* silently ignore addresses over the limit */
|
||||||
@ -552,10 +552,9 @@ static DOHcode doh_store_a(const unsigned char *doh, int index,
|
|||||||
memcpy(&a->ip.v4, &doh[index], 4);
|
memcpy(&a->ip.v4, &doh[index], 4);
|
||||||
d->numaddr++;
|
d->numaddr++;
|
||||||
}
|
}
|
||||||
return DOH_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static DOHcode doh_store_aaaa(const unsigned char *doh, int index,
|
static void doh_store_aaaa(const unsigned char *doh, int index,
|
||||||
struct dohentry *d)
|
struct dohentry *d)
|
||||||
{
|
{
|
||||||
/* silently ignore addresses over the limit */
|
/* silently ignore addresses over the limit */
|
||||||
@ -565,7 +564,6 @@ static DOHcode doh_store_aaaa(const unsigned char *doh, int index,
|
|||||||
memcpy(&a->ip.v6, &doh[index], 16);
|
memcpy(&a->ip.v6, &doh[index], 16);
|
||||||
d->numaddr++;
|
d->numaddr++;
|
||||||
}
|
}
|
||||||
return DOH_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_HTTPSRR
|
#ifdef USE_HTTPSRR
|
||||||
@ -653,16 +651,12 @@ static DOHcode doh_rdata(const unsigned char *doh,
|
|||||||
case DNS_TYPE_A:
|
case DNS_TYPE_A:
|
||||||
if(rdlength != 4)
|
if(rdlength != 4)
|
||||||
return DOH_DNS_RDATA_LEN;
|
return DOH_DNS_RDATA_LEN;
|
||||||
rc = doh_store_a(doh, index, d);
|
doh_store_a(doh, index, d);
|
||||||
if(rc)
|
|
||||||
return rc;
|
|
||||||
break;
|
break;
|
||||||
case DNS_TYPE_AAAA:
|
case DNS_TYPE_AAAA:
|
||||||
if(rdlength != 16)
|
if(rdlength != 16)
|
||||||
return DOH_DNS_RDATA_LEN;
|
return DOH_DNS_RDATA_LEN;
|
||||||
rc = doh_store_aaaa(doh, index, d);
|
doh_store_aaaa(doh, index, d);
|
||||||
if(rc)
|
|
||||||
return rc;
|
|
||||||
break;
|
break;
|
||||||
#ifdef USE_HTTPSRR
|
#ifdef USE_HTTPSRR
|
||||||
case DNS_TYPE_HTTPS:
|
case DNS_TYPE_HTTPS:
|
||||||
|
Loading…
Reference in New Issue
Block a user