mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #5945 from kjbracey-arm/dns_multiple
Correct return value of nsapi_dns_query_multiplepull/5966/head
commit
49cdb0bb07
|
@ -214,7 +214,7 @@ static nsapi_size_or_error_t nsapi_dns_query_multiple(NetworkStack *stack, const
|
||||||
socket.set_timeout(DNS_TIMEOUT);
|
socket.set_timeout(DNS_TIMEOUT);
|
||||||
|
|
||||||
// create network packet
|
// create network packet
|
||||||
uint8_t *packet = (uint8_t *)malloc(DNS_BUFFER_SIZE);
|
uint8_t * const packet = (uint8_t *)malloc(DNS_BUFFER_SIZE);
|
||||||
if (!packet) {
|
if (!packet) {
|
||||||
return NSAPI_ERROR_NO_MEMORY;
|
return NSAPI_ERROR_NO_MEMORY;
|
||||||
}
|
}
|
||||||
|
@ -243,8 +243,9 @@ static nsapi_size_or_error_t nsapi_dns_query_multiple(NetworkStack *stack, const
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint8_t *response = packet;
|
const uint8_t *response = packet;
|
||||||
if (dns_scan_response(&response, addr, addr_count) > 0) {
|
int count = dns_scan_response(&response, addr, addr_count);
|
||||||
result = NSAPI_ERROR_OK;
|
if (count > 0) {
|
||||||
|
result = count;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The DNS response is final, no need to check other servers */
|
/* The DNS response is final, no need to check other servers */
|
||||||
|
|
Loading…
Reference in New Issue