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
3130e592
Commit
3130e592
authored
Nov 02, 2018
by
Deomid Ryabkov
Committed by
Cesanta Bot
Nov 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stop reading if connection is closing
CL: none PUBLISHED_FROM=3b74ca02e2960bbbf130f6d95aef679f2917e824
parent
93286836
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
mongoose.c
mongoose.c
+4
-2
mg_net.c
src/mg_net.c
+4
-2
unit_test.c
test/unit_test.c
+1
-1
No files found.
mongoose.c
View file @
3130e592
...
...
@@ -2895,7 +2895,7 @@ static int mg_do_recv(struct mg_connection *nc) {
}
else
{
res
=
mg_recv_tcp
(
nc
,
buf
,
len
);
}
}
while
(
res
>
0
);
}
while
(
res
>
0
&&
!
(
nc
->
flags
&
(
MG_F_CLOSE_IMMEDIATELY
|
MG_F_UDP
))
);
return
res
;
}
...
...
@@ -3012,7 +3012,9 @@ static int mg_recv_udp(struct mg_connection *nc, char *buf, size_t len) {
mg_hexdump_connection
(
nc
,
nc
->
mgr
->
hexdump_file
,
buf
,
n
,
MG_EV_RECV
);
}
#endif
mg_call
(
nc
,
NULL
,
nc
->
user_data
,
MG_EV_RECV
,
&
n
);
if
(
n
!=
0
)
{
mg_call
(
nc
,
NULL
,
nc
->
user_data
,
MG_EV_RECV
,
&
n
);
}
}
out:
...
...
src/mg_net.c
View file @
3130e592
...
...
@@ -578,7 +578,7 @@ static int mg_do_recv(struct mg_connection *nc) {
}
else
{
res
=
mg_recv_tcp
(
nc
,
buf
,
len
);
}
}
while
(
res
>
0
);
}
while
(
res
>
0
&&
!
(
nc
->
flags
&
(
MG_F_CLOSE_IMMEDIATELY
|
MG_F_UDP
))
);
return
res
;
}
...
...
@@ -695,7 +695,9 @@ static int mg_recv_udp(struct mg_connection *nc, char *buf, size_t len) {
mg_hexdump_connection
(
nc
,
nc
->
mgr
->
hexdump_file
,
buf
,
n
,
MG_EV_RECV
);
}
#endif
mg_call
(
nc
,
NULL
,
nc
->
user_data
,
MG_EV_RECV
,
&
n
);
if
(
n
!=
0
)
{
mg_call
(
nc
,
NULL
,
nc
->
user_data
,
MG_EV_RECV
,
&
n
);
}
}
out:
...
...
test/unit_test.c
View file @
3130e592
...
...
@@ -5665,7 +5665,7 @@ static const char *test_socks(void) {
mbuf_resize
(
&
c
->
recv_mbuf
,
10000000
);
/* Run event loop. Use more cycles to let file download complete. */
poll_until
(
&
mgr
,
1
0
,
c_str_ne
,
status
,
(
void
*
)
""
);
poll_until
(
&
mgr
,
1
5
,
c_str_ne
,
status
,
(
void
*
)
""
);
ASSERT_STREQ
(
status
,
"success"
);
mg_mgr_free
(
&
mgr
);
...
...
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