mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-29 12:41:03 +00:00
Change mg_resolve()
This commit is contained in:
1 parent
2f981f9383
commit
3b0a509cae
5 files changed
+18
-18
No files matched your search
+1
-3
@@ -369,15 +369,13 @@ struct mg_connection *mg_connect(struct mg_mgr *mgr, const char *url,
|
||||
if ((c = alloc_conn(mgr, 1, INVALID_SOCKET)) == NULL) {
|
||||
LOG(LL_ERROR, ("OOM"));
|
||||
} else {
|
||||
struct mg_str host = mg_url_host(url);
|
||||
LIST_ADD_HEAD(struct mg_connection, &mgr->conns, c);
|
||||
c->is_udp = (strncmp(url, "udp:", 4) == 0);
|
||||
c->peer.port = mg_htons(mg_url_port(url));
|
||||
c->fn = fn;
|
||||
c->fn_data = fn_data;
|
||||
LOG(LL_DEBUG, ("%lu -> %s", c->id, url));
|
||||
mg_call(c, MG_EV_OPEN, NULL);
|
||||
mg_resolve(c, &host, mgr->dnstimeout);
|
||||
mg_resolve(c, url);
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user