mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-16 10:39:49 +00:00
Change MG_MAX_RECV_BUF_SIZE -> MG_MAX_RECV_SIZE
This commit is contained in:
1 parent
73a5ff1fb6
commit
a88ea776a9
8 files changed
+12
-12
No files matched your search
+2
-2
@@ -67,8 +67,8 @@
|
||||
#endif
|
||||
|
||||
// Maximum size of the recv IO buffer
|
||||
#ifndef MG_MAX_RECV_BUF_SIZE
|
||||
#define MG_MAX_RECV_BUF_SIZE (3 * 1024 * 1024)
|
||||
#ifndef MG_MAX_RECV_SIZE
|
||||
#define MG_MAX_RECV_SIZE (3 * 1024 * 1024)
|
||||
#endif
|
||||
|
||||
#ifndef MG_MAX_HTTP_HEADERS
|
||||
|
||||
@@ -446,7 +446,7 @@ static void rx_udp(struct mip_if *ifp, struct pkt *pkt) {
|
||||
} else if (c != NULL) {
|
||||
c->rem.port = pkt->udp->sport;
|
||||
c->rem.ip = pkt->ip->src;
|
||||
if (c->recv.len >= MG_MAX_RECV_BUF_SIZE) {
|
||||
if (c->recv.len >= MG_MAX_RECV_SIZE) {
|
||||
mg_error(c, "max_recv_buf_size reached");
|
||||
} else if (c->recv.size - c->recv.len < pkt->pay.len &&
|
||||
!mg_iobuf_resize(&c->recv, c->recv.len + pkt->pay.len)) {
|
||||
|
||||
+1
-1
@@ -278,7 +278,7 @@ static long mg_sock_recv(struct mg_connection *c, void *buf, size_t len) {
|
||||
// (e.g. FreeRTOS stack) return 0 instead of -1/EWOULDBLOCK when no data
|
||||
static long read_conn(struct mg_connection *c) {
|
||||
long n = -1;
|
||||
if (c->recv.len >= MG_MAX_RECV_BUF_SIZE) {
|
||||
if (c->recv.len >= MG_MAX_RECV_SIZE) {
|
||||
mg_error(c, "max_recv_buf_size reached");
|
||||
} else if (c->recv.size - c->recv.len < MG_IO_SIZE &&
|
||||
!mg_iobuf_resize(&c->recv, c->recv.size + MG_IO_SIZE)) {
|
||||
|
||||
Reference in new issue
Block a user