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
f56dcb89
Commit
f56dcb89
authored
Jan 29, 2012
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed match_extension()
parent
8b65d40f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
mongoose.c
mongoose.c
+9
-10
No files found.
mongoose.c
View file @
f56dcb89
...
@@ -800,10 +800,6 @@ static int match_prefix(const char *pattern, int pattern_len, const char *str) {
...
@@ -800,10 +800,6 @@ static int match_prefix(const char *pattern, int pattern_len, const char *str) {
return
j
;
return
j
;
}
}
static
int
full_match
(
const
char
*
path
,
const
char
*
pattern
)
{
return
match_prefix
(
pattern
,
strlen
(
pattern
),
path
)
==
(
int
)
strlen
(
path
);
}
// HTTP 1.1 assumes keep alive if "Connection:" header is not set
// HTTP 1.1 assumes keep alive if "Connection:" header is not set
// This function must tolerate situations when connection info is not
// This function must tolerate situations when connection info is not
// set up, for example if request parsing failed.
// set up, for example if request parsing failed.
...
@@ -3106,7 +3102,6 @@ static void send_ssi_file(struct mg_connection *, const char *, FILE *, int);
...
@@ -3106,7 +3102,6 @@ static void send_ssi_file(struct mg_connection *, const char *, FILE *, int);
static
void
do_ssi_include
(
struct
mg_connection
*
conn
,
const
char
*
ssi
,
static
void
do_ssi_include
(
struct
mg_connection
*
conn
,
const
char
*
ssi
,
char
*
tag
,
int
include_level
)
{
char
*
tag
,
int
include_level
)
{
char
file_name
[
BUFSIZ
],
path
[
PATH_MAX
],
*
p
;
char
file_name
[
BUFSIZ
],
path
[
PATH_MAX
],
*
p
;
int
is_ssi
;
FILE
*
fp
;
FILE
*
fp
;
// sscanf() is safe here, since send_ssi_file() also uses buffer
// sscanf() is safe here, since send_ssi_file() also uses buffer
...
@@ -3137,8 +3132,8 @@ static void do_ssi_include(struct mg_connection *conn, const char *ssi,
...
@@ -3137,8 +3132,8 @@ static void do_ssi_include(struct mg_connection *conn, const char *ssi,
tag
,
path
,
strerror
(
ERRNO
));
tag
,
path
,
strerror
(
ERRNO
));
}
else
{
}
else
{
set_close_on_exec
(
fileno
(
fp
));
set_close_on_exec
(
fileno
(
fp
));
i
s_ssi
=
full_match
(
path
,
conn
->
ctx
->
config
[
SSI_EXTENSIONS
]);
i
f
(
match_prefix
(
conn
->
ctx
->
config
[
SSI_EXTENSIONS
],
if
(
is_ssi
)
{
strlen
(
conn
->
ctx
->
config
[
SSI_EXTENSIONS
]),
path
)
>
0
)
{
send_ssi_file
(
conn
,
path
,
fp
,
include_level
+
1
);
send_ssi_file
(
conn
,
path
,
fp
,
include_level
+
1
);
}
else
{
}
else
{
send_file_data
(
conn
,
fp
,
INT64_MAX
);
send_file_data
(
conn
,
fp
,
INT64_MAX
);
...
@@ -3372,7 +3367,9 @@ static void handle_request(struct mg_connection *conn) {
...
@@ -3372,7 +3367,9 @@ static void handle_request(struct mg_connection *conn) {
"Directory listing denied"
);
"Directory listing denied"
);
}
}
#if !defined(NO_CGI)
#if !defined(NO_CGI)
}
else
if
(
full_match
(
path
,
conn
->
ctx
->
config
[
CGI_EXTENSIONS
]))
{
}
else
if
(
match_prefix
(
conn
->
ctx
->
config
[
CGI_EXTENSIONS
],
strlen
(
conn
->
ctx
->
config
[
CGI_EXTENSIONS
]),
path
)
>
0
)
{
if
(
strcmp
(
ri
->
request_method
,
"POST"
)
&&
if
(
strcmp
(
ri
->
request_method
,
"POST"
)
&&
strcmp
(
ri
->
request_method
,
"GET"
))
{
strcmp
(
ri
->
request_method
,
"GET"
))
{
send_http_error
(
conn
,
501
,
"Not Implemented"
,
send_http_error
(
conn
,
501
,
"Not Implemented"
,
...
@@ -3381,7 +3378,9 @@ static void handle_request(struct mg_connection *conn) {
...
@@ -3381,7 +3378,9 @@ static void handle_request(struct mg_connection *conn) {
handle_cgi_request
(
conn
,
path
);
handle_cgi_request
(
conn
,
path
);
}
}
#endif // !NO_CGI
#endif // !NO_CGI
}
else
if
(
full_match
(
path
,
conn
->
ctx
->
config
[
SSI_EXTENSIONS
]))
{
}
else
if
(
match_prefix
(
conn
->
ctx
->
config
[
SSI_EXTENSIONS
],
strlen
(
conn
->
ctx
->
config
[
SSI_EXTENSIONS
]),
path
)
>
0
)
{
handle_ssi_file_request
(
conn
,
path
);
handle_ssi_file_request
(
conn
,
path
);
}
else
if
(
is_not_modified
(
conn
,
&
st
))
{
}
else
if
(
is_not_modified
(
conn
,
&
st
))
{
send_http_error
(
conn
,
304
,
"Not Modified"
,
""
);
send_http_error
(
conn
,
304
,
"Not Modified"
,
""
);
...
...
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