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
845d7b08
Commit
845d7b08
authored
Feb 08, 2013
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed assert for keepalive code path
parent
49bac31d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
mongoose.c
mongoose.c
+6
-7
No files found.
mongoose.c
View file @
845d7b08
...
...
@@ -2882,6 +2882,7 @@ static int read_request(FILE *fp, struct mg_connection *conn,
while
(
*
nread
<
bufsiz
&&
request_len
==
0
&&
(
n
=
pull
(
fp
,
conn
,
buf
+
*
nread
,
bufsiz
-
*
nread
))
>
0
)
{
*
nread
+=
n
;
assert
(
*
nread
<=
bufsiz
);
request_len
=
get_request_len
(
buf
,
*
nread
);
}
...
...
@@ -4821,21 +4822,19 @@ static void process_new_connection(struct mg_connection *conn) {
// is using parsed request, which will be invalid after memmove's below.
// Therefore, memorize should_keep_alive() result now for later use
// in loop exit condition.
keep_alive
=
should_keep_alive
(
conn
);
keep_alive
=
conn
->
ctx
->
stop_flag
==
0
&&
keep_alive_enabled
&&
conn
->
content_len
>=
0
&&
should_keep_alive
(
conn
);
// Discard all buffered data for this request
discard_len
=
conn
->
content_len
>=
0
&&
discard_len
=
conn
->
content_len
>=
0
&&
conn
->
request_len
>
0
&&
conn
->
request_len
+
conn
->
content_len
<
(
int64_t
)
conn
->
data_len
?
(
int
)
(
conn
->
request_len
+
conn
->
content_len
)
:
conn
->
data_len
;
assert
(
discard_len
>=
0
);
memmove
(
conn
->
buf
,
conn
->
buf
+
discard_len
,
conn
->
data_len
-
discard_len
);
conn
->
data_len
-=
discard_len
;
assert
(
conn
->
data_len
>=
0
);
assert
(
conn
->
data_len
<=
conn
->
buf_size
);
}
while
(
conn
->
ctx
->
stop_flag
==
0
&&
keep_alive_enabled
&&
conn
->
content_len
>=
0
&&
keep_alive
);
}
while
(
keep_alive
);
}
// Worker threads take accepted socket from the queue
...
...
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