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
98f6c8aa
Commit
98f6c8aa
authored
Sep 17, 2018
by
Deomid Ryabkov
Committed by
Cesanta Bot
Sep 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trim recv_mbuf when we know the size of the data
CL: none PUBLISHED_FROM=e354b67ab6f8246af50c601f5f70d36c029601ea
parent
341ae53e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
mongoose.c
mongoose.c
+2
-0
mg_net.c
src/mg_net.c
+2
-0
No files found.
mongoose.c
View file @
98f6c8aa
...
...
@@ -2928,10 +2928,12 @@ static int mg_recv_tcp(struct mg_connection *nc, char *buf, size_t len) {
mg_hexdump_connection
(
nc
,
nc
->
mgr
->
hexdump_file
,
buf
,
n
,
MG_EV_RECV
);
}
#endif
mbuf_trim
(
&
nc
->
recv_mbuf
);
mg_call
(
nc
,
NULL
,
nc
->
user_data
,
MG_EV_RECV
,
&
n
);
}
else
if
(
n
<
0
)
{
nc
->
flags
|=
MG_F_CLOSE_IMMEDIATELY
;
}
mbuf_trim
(
&
nc
->
recv_mbuf
);
return
n
;
}
...
...
src/mg_net.c
View file @
98f6c8aa
...
...
@@ -619,10 +619,12 @@ static int mg_recv_tcp(struct mg_connection *nc, char *buf, size_t len) {
mg_hexdump_connection
(
nc
,
nc
->
mgr
->
hexdump_file
,
buf
,
n
,
MG_EV_RECV
);
}
#endif
mbuf_trim
(
&
nc
->
recv_mbuf
);
mg_call
(
nc
,
NULL
,
nc
->
user_data
,
MG_EV_RECV
,
&
n
);
}
else
if
(
n
<
0
)
{
nc
->
flags
|=
MG_F_CLOSE_IMMEDIATELY
;
}
mbuf_trim
(
&
nc
->
recv_mbuf
);
return
n
;
}
...
...
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