Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
mongoose
Commits
987bc1d5
Commit
987bc1d5
authored
Dec 02, 2017
by
Sergey Lyubka
Committed by
Cesanta Bot
Dec 02, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use 8k iobuf limit for aws
PUBLISHED_FROM=971951e1eeb82078b986cd6e25e52cfc1ccef286
parent
ddd35c0c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
11 deletions
+14
-11
main.c
examples/CC3200/main.c
+1
-1
mongoose.c
mongoose.c
+13
-10
No files found.
examples/CC3200/main.c
View file @
987bc1d5
...
...
@@ -176,7 +176,7 @@ static void mg_init(struct mg_mgr *mgr) {
memset
(
&
ver
,
0
,
sizeof
(
ver
));
sl_DevGet
(
SL_DEVICE_GENERAL_CONFIGURATION
,
&
opt
,
&
len
,
(
unsigned
char
*
)
(
&
ver
));
LOG
(
LL_INFO
,
(
"NWP v%
d.%d.%d.%d started, host v%d.%d.%d.%
d"
,
LOG
(
LL_INFO
,
(
"NWP v%
ld.%ld.%ld.%ld started, host v%ld.%ld.%ld.%l
d"
,
ver
.
NwpVersion
[
0
],
ver
.
NwpVersion
[
1
],
ver
.
NwpVersion
[
2
],
ver
.
NwpVersion
[
3
],
SL_MAJOR_VERSION_NUM
,
SL_MINOR_VERSION_NUM
,
SL_VERSION_NUM
,
SL_SUB_VERSION_NUM
));
...
...
mongoose.c
View file @
987bc1d5
...
...
@@ -2185,8 +2185,8 @@ void mg_tun_destroy_client(struct mg_tun_client *client);
/* Amalgamated: #include "mongoose/src/dns.h" */
/* Amalgamated: #include "mongoose/src/internal.h" */
/* Amalgamated: #include "mongoose/src/resolv.h" */
/* Amalgamated: #include "mongoose/src/util.h" */
/* Amalgamated: #include "mongoose/src/tun.h" */
/* Amalgamated: #include "mongoose/src/util.h" */
#define MG_MAX_HOST_LEN 200
...
...
@@ -2703,6 +2703,17 @@ MG_INTERNAL void mg_recv_common(struct mg_connection *nc, void *buf, int len,
MG_FREE
(
buf
);
}
mg_call
(
nc
,
NULL
,
nc
->
user_data
,
MG_EV_RECV
,
&
len
);
/* If the buffer is still full after the user callback, fail */
if
(
nc
->
recv_mbuf_limit
>
0
&&
nc
->
recv_mbuf
.
len
>=
nc
->
recv_mbuf_limit
)
{
char
h1
[
50
],
h2
[
50
];
int
flags
=
MG_SOCK_STRINGIFY_IP
|
MG_SOCK_STRINGIFY_PORT
;
mg_conn_addr_to_str
(
nc
,
h1
,
sizeof
(
h1
),
flags
);
mg_conn_addr_to_str
(
nc
,
h2
,
sizeof
(
h2
),
flags
|
MG_SOCK_STRINGIFY_REMOTE
);
LOG
(
LL_ERROR
,
(
"%p %s <-> %s recv buffer %lu bytes, not drained, closing"
,
nc
,
h1
,
h2
,
(
unsigned
long
)
nc
->
recv_mbuf
.
len
));
nc
->
flags
|=
MG_F_CLOSE_IMMEDIATELY
;
}
}
void
mg_if_recv_tcp_cb
(
struct
mg_connection
*
nc
,
void
*
buf
,
int
len
,
int
own
)
{
...
...
@@ -15754,14 +15765,6 @@ uint32_t mg_lwip_get_poll_delay_ms(struct mg_mgr *mgr) {
#define MG_LWIP_SSL_IO_SIZE 1024
#endif
/*
* Stop processing incoming SSL traffic when recv_mbuf.size is this big.
* It'a a uick solution for SSL recv pushback.
*/
#ifndef MG_LWIP_SSL_RECV_MBUF_LIMIT
#define MG_LWIP_SSL_RECV_MBUF_LIMIT 3072
#endif
#ifndef MIN
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif
...
...
@@ -15842,7 +15845,7 @@ void mg_lwip_ssl_recv(struct mg_connection *nc) {
struct
mg_lwip_conn_state
*
cs
=
(
struct
mg_lwip_conn_state
*
)
nc
->
sock
;
/* Don't deliver data before connect callback */
if
(
nc
->
flags
&
MG_F_CONNECTING
)
return
;
while
(
nc
->
recv_mbuf
.
len
<
MG_LWIP_SSL_RECV_MBUF_LIMIT
)
{
while
(
nc
->
recv_mbuf
.
len
<
nc
->
recv_mbuf_limit
)
{
char
*
buf
=
(
char
*
)
MG_MALLOC
(
MG_LWIP_SSL_IO_SIZE
);
if
(
buf
==
NULL
)
return
;
int
ret
=
mg_ssl_if_read
(
nc
,
buf
,
MG_LWIP_SSL_IO_SIZE
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment