mirror of
https://github.com/cesanta/mongoose.git
synced 2024-11-28 13:49:01 +08:00
Check listener when reusing UDP conn. Closes cesanta/dev#3139
PUBLISHED_FROM=f03f8fad30faee62f290d37b0b909ef49f301b80
This commit is contained in:
parent
fe0d340c03
commit
55c2634416
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user