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
d883b0f0
Commit
d883b0f0
authored
Sep 20, 2012
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent possible assert fail on windows in handle_cgi_request()
parent
0b942aaa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
mongoose.c
mongoose.c
+9
-7
No files found.
mongoose.c
View file @
d883b0f0
...
@@ -3110,7 +3110,15 @@ static void handle_cgi_request(struct mg_connection *conn, const char *prog) {
...
@@ -3110,7 +3110,15 @@ static void handle_cgi_request(struct mg_connection *conn, const char *prog) {
send_http_error
(
conn
,
500
,
http_500_error
,
send_http_error
(
conn
,
500
,
http_500_error
,
"Cannot spawn CGI process [%s]: %s"
,
prog
,
strerror
(
ERRNO
));
"Cannot spawn CGI process [%s]: %s"
,
prog
,
strerror
(
ERRNO
));
goto
done
;
goto
done
;
}
else
if
((
in
=
fdopen
(
fd_stdin
[
1
],
"wb"
))
==
NULL
||
}
// spawn_process() must close those!
// If we don't mark them as closed, close() attempt before
// return from this function throws an exception on Windows.
// Windows does not like when closed descriptor is closed again.
fd_stdin
[
0
]
=
fd_stdout
[
1
]
=
-
1
;
if
((
in
=
fdopen
(
fd_stdin
[
1
],
"wb"
))
==
NULL
||
(
out
=
fdopen
(
fd_stdout
[
0
],
"rb"
))
==
NULL
)
{
(
out
=
fdopen
(
fd_stdout
[
0
],
"rb"
))
==
NULL
)
{
send_http_error
(
conn
,
500
,
http_500_error
,
send_http_error
(
conn
,
500
,
http_500_error
,
"fopen: %s"
,
strerror
(
ERRNO
));
"fopen: %s"
,
strerror
(
ERRNO
));
...
@@ -3120,12 +3128,6 @@ static void handle_cgi_request(struct mg_connection *conn, const char *prog) {
...
@@ -3120,12 +3128,6 @@ static void handle_cgi_request(struct mg_connection *conn, const char *prog) {
setbuf
(
in
,
NULL
);
setbuf
(
in
,
NULL
);
setbuf
(
out
,
NULL
);
setbuf
(
out
,
NULL
);
// spawn_process() must close those!
// If we don't mark them as closed, close() attempt before
// return from this function throws an exception on Windows.
// Windows does not like when closed descriptor is closed again.
fd_stdin
[
0
]
=
fd_stdout
[
1
]
=
-
1
;
// Send POST data to the CGI process if needed
// Send POST data to the CGI process if needed
if
(
!
strcmp
(
conn
->
request_info
.
request_method
,
"POST"
)
&&
if
(
!
strcmp
(
conn
->
request_info
.
request_method
,
"POST"
)
&&
!
forward_body_data
(
conn
,
in
,
INVALID_SOCKET
,
NULL
))
{
!
forward_body_data
(
conn
,
in
,
INVALID_SOCKET
,
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