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
ab1c4649
Commit
ab1c4649
authored
8 years ago
by
Sergey Lyubka
Committed by
Cesanta Bot
8 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix
https://github.com/cesanta/mongoose/issues/765
PUBLISHED_FROM=f7f8ce9421d96a5f0d90afe4c930c53662b4e907
parent
f20b5191
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
mongoose.c
mongoose.c
+13
-3
No files found.
mongoose.c
View file @
ab1c4649
...
...
@@ -5446,6 +5446,13 @@ void mg_http_handler(struct mg_connection *nc, int ev, void *ev_data) {
struct
mg_str
*
vec
;
#endif
if
(
ev
==
MG_EV_CLOSE
)
{
#if MG_ENABLE_HTTP_CGI
/* Close associated CGI forwarder connection */
if
(
pd
->
cgi
.
cgi_nc
!=
NULL
)
{
pd
->
cgi
.
cgi_nc
->
user_data
=
NULL
;
pd
->
cgi
.
cgi_nc
->
flags
|=
MG_F_CLOSE_IMMEDIATELY
;
}
#endif
#if MG_ENABLE_HTTP_STREAMING_MULTIPART
if
(
pd
->
mp_stream
.
boundary
!=
NULL
)
{
/*
...
...
@@ -8049,7 +8056,10 @@ static void mg_cgi_ev_handler(struct mg_connection *cgi_nc, int ev,
struct
mg_connection
*
nc
=
(
struct
mg_connection
*
)
cgi_nc
->
user_data
;
(
void
)
ev_data
;
if
(
nc
==
NULL
)
return
;
if
(
nc
==
NULL
)
{
cgi_nc
->
flags
|=
MG_F_CLOSE_IMMEDIATELY
;
return
;
}
switch
(
ev
)
{
case
MG_EV_RECV
:
...
...
@@ -8093,7 +8103,7 @@ static void mg_cgi_ev_handler(struct mg_connection *cgi_nc, int ev,
}
break
;
case
MG_EV_CLOSE
:
mg_http_free_proto_data_cgi
(
&
mg_http_get_proto_data
(
cgi_
nc
)
->
cgi
);
mg_http_free_proto_data_cgi
(
&
mg_http_get_proto_data
(
nc
)
->
cgi
);
nc
->
flags
|=
MG_F_SEND_AND_CLOSE
;
break
;
}
...
...
@@ -8136,7 +8146,7 @@ MG_INTERNAL void mg_handle_cgi(struct mg_connection *nc, const char *prog,
size_t
n
=
nc
->
recv_mbuf
.
len
-
(
hm
->
message
.
len
-
hm
->
body
.
len
);
struct
mg_connection
*
cgi_nc
=
mg_add_sock
(
nc
->
mgr
,
fds
[
0
],
mg_cgi_ev_handler
);
struct
mg_http_proto_data
*
cgi_pd
=
mg_http_get_proto_data
(
cgi_
nc
);
struct
mg_http_proto_data
*
cgi_pd
=
mg_http_get_proto_data
(
nc
);
cgi_pd
->
cgi
.
cgi_nc
=
cgi_nc
;
cgi_pd
->
cgi
.
cgi_nc
->
user_data
=
nc
;
nc
->
flags
|=
MG_F_USER_1
;
...
...
This diff is collapsed.
Click to expand it.
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