Fix connection reuse in mg_if_recv_udp_cb

PUBLISHED_FROM=5d248fd465ade7f42293611bc2d60ed72439a489
This commit is contained in:
Alexander Alashkin authored and rojer committed 2016-04-01 03:14:22 +01:00
1 parent 06659844b6
commit 356f1f5119
1 file changed
+2 -1
+2 -1
View File
@@ -2684,7 +2684,6 @@ void mg_if_recv_udp_cb(struct mg_connection *nc, void *buf, int len,
struct mg_add_sock_opts opts; struct mg_add_sock_opts opts;
memset(&opts, 0, sizeof(opts)); memset(&opts, 0, sizeof(opts));
nc = mg_create_connection(lc->mgr, lc->handler, opts); nc = mg_create_connection(lc->mgr, lc->handler, opts);
}
if (nc != NULL) { if (nc != NULL) {
nc->sock = lc->sock; nc->sock = lc->sock;
nc->listener = lc; nc->listener = lc;
@@ -2697,6 +2696,8 @@ void mg_if_recv_udp_cb(struct mg_connection *nc, void *buf, int len,
mg_call(nc, NULL, MG_EV_ACCEPT, &nc->sa); mg_call(nc, NULL, MG_EV_ACCEPT, &nc->sa);
} else { } else {
DBG(("OOM")); DBG(("OOM"));
/* No return here, we still need to drop on the floor */
}
} }
} }
if (nc != NULL) { if (nc != NULL) {