This commit is contained in:
cpq committed 2021-01-24 13:57:40 +00:00
1 parent 7d67d578fd
commit 9a19485454
4 files changed
+26 -14

No files matched your search

+5 -2
View File
@@ -156,8 +156,11 @@ static void dns_cb(struct mg_connection *c, int ev, void *ev_data,
if (d->c->is_resolving) {
d->c->is_resolving = 0;
if (dm.resolved) {
char buf[100];
dm.addr.port = d->c->peer.port; // Save port
d->c->peer = dm.addr; // Copy resolved address
LOG(LL_DEBUG, ("%lu %s resolved to %s", d->c->id, dm.name,
mg_ntoa(&d->c->peer, buf, sizeof(buf))));
mg_connect_resolved(d->c);
#if MG_ENABLE_IPV6
} else if (dm.addr.is_ip6 == false && dm.name[0] != '\0') {
@@ -243,8 +246,8 @@ static void mg_sendnsreq(struct mg_connection *c, struct mg_str *name, int ms,
d->expire = mg_millis() + ms;
d->c = c;
c->is_resolving = 1;
LOG(LL_DEBUG, ("%lu resolving %.*s, txnid %hu", c->id, (int) name->len,
name->ptr, d->txnid));
LOG(LL_VERBOSE_DEBUG, ("%lu resolving %.*s, txnid %hu", c->id,
(int) name->len, name->ptr, d->txnid));
mg_dns_send(dnsc->c, name, d->txnid, ipv6);
}
}