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
a730afc4
Commit
a730afc4
authored
Aug 14, 2013
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://github.com/valenok/mongoose
parents
94296c96
667707df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
UserManual.md
UserManual.md
+1
-1
mongoose.c
mongoose.c
+12
-4
No files found.
UserManual.md
View file @
a730afc4
...
...
@@ -103,7 +103,7 @@ will fail.
Path to an executable to use as CGI interpreter for __all__ CGI scripts
regardless script extension. If this option is not set (which is a default),
Mongoose looks at first line of a CGI script,
[
shebang line
](
http://en.wikipedia.org/wiki/Shebang_(Unix
)
), for an interpreter.
[
shebang line
](
http://en.wikipedia.org/wiki/Shebang_(Unix
\
)
), for an interpreter.
For example, if both PHP and perl CGIs are used, then
`#!/path/to/php-cgi.exe`
and
`#!/path/to/perl.exe`
must be first lines of the
...
...
mongoose.c
View file @
a730afc4
...
...
@@ -2415,14 +2415,21 @@ static int parse_auth_header(struct mg_connection *conn, char *buf,
static
char
*
mg_fgets
(
char
*
buf
,
size_t
size
,
struct
file
*
filep
,
char
**
p
)
{
char
*
eof
;
size_t
len
;
char
*
memend
;
if
(
filep
->
membuf
!=
NULL
&&
*
p
!=
NULL
)
{
eof
=
(
char
*
)
memchr
(
*
p
,
'\n'
,
&
filep
->
membuf
[
filep
->
size
]
-
*
p
);
len
=
(
size_t
)
(
eof
-
*
p
)
>
size
-
1
?
size
-
1
:
(
size_t
)
(
eof
-
*
p
);
memend
=
(
char
*
)
&
filep
->
membuf
[
filep
->
size
];
eof
=
(
char
*
)
memchr
(
*
p
,
'\n'
,
memend
-
*
p
);
// Search for \n from p till the end of stream
if
(
eof
!=
NULL
)
{
eof
+=
1
;
// Include \n
}
else
{
eof
=
memend
;
// Copy remaining data
}
len
=
(
size_t
)
(
eof
-
*
p
)
>
size
-
1
?
size
-
1
:
(
size_t
)
(
eof
-
*
p
);
memcpy
(
buf
,
*
p
,
len
);
buf
[
len
]
=
'\0'
;
*
p
=
eof
;
return
eof
;
*
p
+=
len
;
return
len
?
eof
:
NULL
;
}
else
if
(
filep
->
fp
!=
NULL
)
{
return
fgets
(
buf
,
size
,
filep
->
fp
);
}
else
{
...
...
@@ -3272,6 +3279,7 @@ static void prepare_cgi_environment(struct mg_connection *conn,
addenv
(
blk
,
"SERVER_NAME=%s"
,
conn
->
ctx
->
config
[
AUTHENTICATION_DOMAIN
]);
addenv
(
blk
,
"SERVER_ROOT=%s"
,
conn
->
ctx
->
config
[
DOCUMENT_ROOT
]);
addenv
(
blk
,
"DOCUMENT_ROOT=%s"
,
conn
->
ctx
->
config
[
DOCUMENT_ROOT
]);
addenv
(
blk
,
"SERVER_SOFTWARE=%s/%s"
,
"Mongoose"
,
mg_version
());
// Prepare the environment block
addenv
(
blk
,
"%s"
,
"GATEWAY_INTERFACE=CGI/1.1"
);
...
...
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