Commit a07fb2be authored by Deomid Ryabkov's avatar Deomid Ryabkov Committed by Cesanta Bot

Log DNS failures in mOS

To aid disagnosing cases like https://forum.cesanta.com/index.php?p=/discussion/397/retries-connecting-to-aws-broker

PUBLISHED_FROM=98680b594dbed42234fc53050c9df292feb32f35
parent 7f259f2a
......@@ -11001,6 +11001,11 @@ static void mg_resolve_async_eh(struct mg_connection *nc, int ev,
case MG_EV_CLOSE:
/* If we got here with request still not done, fire an error callback. */
if (req != NULL) {
char addr[32];
mg_sock_addr_to_str(&nc->sa, addr, sizeof(addr), MG_SOCK_STRINGIFY_IP);
#ifdef MG_LOG_DNS_FAILURES
LOG(LL_ERROR, ("Failed to resolve '%s', server %s", req->name, addr));
#endif
req->callback(NULL, req->data, req->err);
nc->user_data = NULL;
MG_FREE(req);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment