mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-17 19:30:36 +00:00
fix recvfrom in IPv6
This commit is contained in:
1 parent
49e71ba666
commit
ee338b7bba
2 files changed
+4
-4
No files matched your search
+2
-2
@@ -16400,9 +16400,9 @@ static long recv_raw(struct mg_connection *c, void *buf, size_t len) {
|
||||
long n = 0;
|
||||
if (c->is_udp) {
|
||||
union usa usa;
|
||||
socklen_t slen = tousa(&c->rem, &usa);
|
||||
socklen_t slen = sizeof(usa);
|
||||
n = recvfrom(FD(c), (char *) buf, len, 0, &usa.sa, &slen);
|
||||
if (n > 0) tomgaddr(&usa, &c->rem, slen != sizeof(usa.sin));
|
||||
if (n > 0) tomgaddr(&usa, &c->rem, usa.sa.sa_family == AF_INET6);
|
||||
} else {
|
||||
n = recv(FD(c), (char *) buf, len, MSG_NONBLOCKING);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user