Commit 55c26344 authored by Alexander Alashkin's avatar Alexander Alashkin Committed by rojer

Check listener when reusing UDP conn. Closes cesanta/dev#3139

PUBLISHED_FROM=f03f8fad30faee62f290d37b0b909ef49f301b80
parent fe0d340c
......@@ -2698,7 +2698,9 @@ void mg_if_recv_udp_cb(struct mg_connection *nc, void *buf, int len,
* This is very inefficient for long connection lists.
*/
for (nc = mg_next(lc->mgr, NULL); nc != NULL; nc = mg_next(lc->mgr, nc)) {
if (memcmp(&nc->sa.sa, &sa->sa, sa_len) == 0) break;
if (memcmp(&nc->sa.sa, &sa->sa, sa_len) == 0 && nc->listener == lc) {
break;
}
}
if (nc == NULL) {
struct mg_add_sock_opts opts;
......
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