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
fa216849
Commit
fa216849
authored
Jan 04, 2014
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resetting connection flags in close_local_endpoint()
parent
df6e35e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
mongoose.c
mongoose.c
+7
-2
No files found.
mongoose.c
View file @
fa216849
...
...
@@ -1900,6 +1900,10 @@ static int find_index_file(struct connection *conn, char *path,
return
found
;
}
static
void
write_terminating_chunk
(
struct
connection
*
conn
)
{
mg_write
(
&
conn
->
mg_conn
,
"0
\r\n\r\n
"
,
5
);
}
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
;
...
...
@@ -1913,7 +1917,7 @@ static void call_uri_handler_if_data_is_buffered(struct connection *conn) {
if
(
loc
->
len
>=
c
->
content_len
)
{
conn
->
endpoint
.
uh
->
handler
(
c
);
if
(
conn
->
flags
&
CONN_HEADERS_SENT
)
{
write_
chunk
(
conn
,
""
,
0
);
// Write final zero-length chunk
write_
terminating_chunk
(
conn
);
}
close_local_endpoint
(
conn
);
}
...
...
@@ -2187,7 +2191,7 @@ static void send_directory_listing(struct connection *conn, const char *dir) {
}
free
(
arr
);
write_
chunk
(
conn
,
""
,
0
);
// Write final zero-length chunk
write_
terminating_chunk
(
conn
);
close_local_endpoint
(
conn
);
}
#endif // NO_DIRECTORY_LISTING
...
...
@@ -3294,6 +3298,7 @@ static void close_local_endpoint(struct connection *conn) {
#endif
conn
->
endpoint_type
=
EP_NONE
;
conn
->
flags
=
0
;
conn
->
cl
=
conn
->
num_bytes_sent
=
conn
->
request_len
=
0
;
free
(
conn
->
request
);
conn
->
request
=
NULL
;
...
...
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