mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-26 12:14:56 +00:00
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
This commit is contained in:
1 parent
7f259f2a79
commit
a07fb2be51
1 file changed
+5
@@ -11001,6 +11001,11 @@ static void mg_resolve_async_eh(struct mg_connection *nc, int ev,
|
|||||||
case MG_EV_CLOSE:
|
case MG_EV_CLOSE:
|
||||||
/* If we got here with request still not done, fire an error callback. */
|
/* If we got here with request still not done, fire an error callback. */
|
||||||
if (req != NULL) {
|
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);
|
req->callback(NULL, req->data, req->err);
|
||||||
nc->user_data = NULL;
|
nc->user_data = NULL;
|
||||||
MG_FREE(req);
|
MG_FREE(req);
|
||||||
|
|||||||
Reference in new issue
Block a user