mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-17 19:30:36 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0f157bd23b |
No files matched your search
+4
-4
@@ -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 = sizeof(usa);
|
||||
socklen_t slen = tousa(&c->rem, &usa);
|
||||
n = recvfrom(FD(c), (char *) buf, len, 0, &usa.sa, &slen);
|
||||
if (n > 0) tomgaddr(&usa, &c->rem, usa.sa.sa_family == AF_INET6);
|
||||
if (n > 0) tomgaddr(&usa, &c->rem, slen != sizeof(usa.sin));
|
||||
} else {
|
||||
n = recv(FD(c), (char *) buf, len, MSG_NONBLOCKING);
|
||||
}
|
||||
@@ -21153,8 +21153,8 @@ void mg_tls_init(struct mg_connection *c, const struct mg_tls_opts *opts) {
|
||||
mg_error(c, "hostname too long");
|
||||
return;
|
||||
}
|
||||
strncpy((char *) tls->hostname, opts->name.buf, sizeof(tls->hostname) - 1);
|
||||
tls->hostname[opts->name.len] = 0;
|
||||
memcpy(tls->hostname, opts->name.buf, opts->name.len);
|
||||
tls->hostname[opts->name.len] = '\0';
|
||||
}
|
||||
|
||||
// server CA certificate; parse PEM [bundle] or DER
|
||||
|
||||
+2
-2
@@ -297,9 +297,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 = sizeof(usa);
|
||||
socklen_t slen = tousa(&c->rem, &usa);
|
||||
n = recvfrom(FD(c), (char *) buf, len, 0, &usa.sa, &slen);
|
||||
if (n > 0) tomgaddr(&usa, &c->rem, usa.sa.sa_family == AF_INET6);
|
||||
if (n > 0) tomgaddr(&usa, &c->rem, slen != sizeof(usa.sin));
|
||||
} else {
|
||||
n = recv(FD(c), (char *) buf, len, MSG_NONBLOCKING);
|
||||
}
|
||||
|
||||
+2
-2
@@ -2748,8 +2748,8 @@ void mg_tls_init(struct mg_connection *c, const struct mg_tls_opts *opts) {
|
||||
mg_error(c, "hostname too long");
|
||||
return;
|
||||
}
|
||||
strncpy((char *) tls->hostname, opts->name.buf, sizeof(tls->hostname) - 1);
|
||||
tls->hostname[opts->name.len] = 0;
|
||||
memcpy(tls->hostname, opts->name.buf, opts->name.len);
|
||||
tls->hostname[opts->name.len] = '\0';
|
||||
}
|
||||
|
||||
// server CA certificate; parse PEM [bundle] or DER
|
||||
|
||||
Reference in new issue
Block a user