Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
136c3e82
Commit
136c3e82
authored
Jan 14, 2014
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eat prior POST data in close_local_endpoint()
parent
7d699ea7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
mongoose.c
mongoose.c
+12
-1
No files found.
mongoose.c
View file @
136c3e82
...
...
@@ -1901,6 +1901,7 @@ static void write_terminating_chunk(struct connection *conn) {
}
static
void
call_uri_handler
(
struct
connection
*
conn
)
{
conn
->
mg_conn
.
content
=
conn
->
local_iobuf
.
buf
;
if
(
conn
->
endpoint
.
uh
->
handler
(
&
conn
->
mg_conn
))
{
if
(
conn
->
flags
&
CONN_HEADERS_SENT
)
{
write_terminating_chunk
(
conn
);
...
...
@@ -2186,7 +2187,6 @@ static void call_uri_handler_if_data_is_buffered(struct connection *conn) {
struct
iobuf
*
loc
=
&
conn
->
local_iobuf
;
struct
mg_connection
*
c
=
&
conn
->
mg_conn
;
c
->
content
=
loc
->
buf
;
#ifndef NO_WEBSOCKET
if
(
conn
->
mg_conn
.
is_websocket
)
{
do
{
}
while
(
deliver_websocket_frame
(
conn
));
...
...
@@ -3539,6 +3539,13 @@ static void log_access(const struct connection *conn, const char *path) {
}
#endif
static
void
gobble_prior_post_data
(
struct
iobuf
*
io
,
int
len
)
{
if
(
len
>
0
&&
len
<=
io
->
len
)
{
memmove
(
io
->
buf
,
io
->
buf
+
len
,
io
->
len
-
len
);
io
->
len
-=
len
;
}
}
static
void
close_local_endpoint
(
struct
connection
*
conn
)
{
// Must be done before free()
int
keep_alive
=
should_keep_alive
(
&
conn
->
mg_conn
)
&&
...
...
@@ -3556,6 +3563,10 @@ static void close_local_endpoint(struct connection *conn) {
}
#endif
if
(
conn
->
endpoint_type
==
EP_USER
)
{
gobble_prior_post_data
(
&
conn
->
local_iobuf
,
conn
->
mg_conn
.
content_len
);
}
conn
->
endpoint_type
=
EP_NONE
;
conn
->
flags
=
0
;
conn
->
cl
=
conn
->
num_bytes_sent
=
conn
->
request_len
=
0
;
...
...
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