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
f105b74d
Commit
f105b74d
authored
Aug 31, 2010
by
valenok
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
experimental keep-alive, options defaults
parent
fed9ffc1
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
159 additions
and
113 deletions
+159
-113
main.c
main.c
+8
-3
mongoose.c
mongoose.c
+145
-108
mongoose.h
mongoose.h
+3
-2
test.pl
test/test.pl
+3
-0
No files found.
main.c
View file @
f105b74d
...
@@ -103,8 +103,9 @@ static void show_usage_and_exit(void) {
...
@@ -103,8 +103,9 @@ static void show_usage_and_exit(void) {
fprintf
(
stderr
,
"OPTIONS:
\n
"
);
fprintf
(
stderr
,
"OPTIONS:
\n
"
);
names
=
mg_get_valid_option_names
();
names
=
mg_get_valid_option_names
();
for
(
i
=
0
;
names
[
i
]
!=
NULL
;
i
+=
2
)
{
for
(
i
=
0
;
names
[
i
]
!=
NULL
;
i
+=
3
)
{
fprintf
(
stderr
,
" -%s %s
\n
"
,
names
[
i
],
names
[
i
+
1
]);
fprintf
(
stderr
,
" -%s %s (default:
\"
%s
\"
)
\n
"
,
names
[
i
],
names
[
i
+
1
],
names
[
i
+
2
]
==
NULL
?
""
:
names
[
i
+
2
]);
}
}
fprintf
(
stderr
,
"See http://code.google.com/p/mongoose/wiki/MongooseManual"
fprintf
(
stderr
,
"See http://code.google.com/p/mongoose/wiki/MongooseManual"
" for more details.
\n
"
);
" for more details.
\n
"
);
...
@@ -164,6 +165,7 @@ static void process_command_line_arguments(char *argv[], char **options) {
...
@@ -164,6 +165,7 @@ static void process_command_line_arguments(char *argv[], char **options) {
const
char
*
config_file
=
NULL
;
const
char
*
config_file
=
NULL
;
char
line
[
512
],
opt
[
512
],
val
[
512
],
path
[
PATH_MAX
],
*
p
;
char
line
[
512
],
opt
[
512
],
val
[
512
],
path
[
PATH_MAX
],
*
p
;
FILE
*
fp
=
NULL
;
FILE
*
fp
=
NULL
;
struct
stat
st
;
size_t
i
,
line_no
=
0
;
size_t
i
,
line_no
=
0
;
/* Should we use a config file ? */
/* Should we use a config file ? */
...
@@ -175,6 +177,9 @@ static void process_command_line_arguments(char *argv[], char **options) {
...
@@ -175,6 +177,9 @@ static void process_command_line_arguments(char *argv[], char **options) {
snprintf
(
path
,
sizeof
(
path
),
"%.*s%s"
,
snprintf
(
path
,
sizeof
(
path
),
"%.*s%s"
,
(
int
)
(
p
-
argv
[
0
])
+
1
,
argv
[
0
],
CONFIG_FILE
);
(
int
)
(
p
-
argv
[
0
])
+
1
,
argv
[
0
],
CONFIG_FILE
);
}
}
if
(
stat
(
path
,
&
st
)
==
0
)
{
config_file
=
path
;
}
}
}
/* If config file was set in command line and open failed, exit */
/* If config file was set in command line and open failed, exit */
if
(
config_file
!=
NULL
&&
(
fp
=
fopen
(
config_file
,
"r"
))
==
NULL
)
{
if
(
config_file
!=
NULL
&&
(
fp
=
fopen
(
config_file
,
"r"
))
==
NULL
)
{
...
...
mongoose.c
View file @
f105b74d
This diff is collapsed.
Click to expand it.
mongoose.h
View file @
f105b74d
...
@@ -118,8 +118,9 @@ void mg_stop(struct mg_context *);
...
@@ -118,8 +118,9 @@ void mg_stop(struct mg_context *);
const
char
*
mg_get_option
(
const
struct
mg_context
*
ctx
,
const
char
*
name
);
const
char
*
mg_get_option
(
const
struct
mg_context
*
ctx
,
const
char
*
name
);
// Return array of valid configuration options. For each option, a short
// Return array of strings that represent valid configuration options.
// version and a long version is returned. Array is NULL terminated.
// For each option, a short name, long name, and default value is returned.
// Array is NULL terminated.
const
char
**
mg_get_valid_option_names
(
void
);
const
char
**
mg_get_valid_option_names
(
void
);
...
...
test/test.pl
View file @
f105b74d
...
@@ -211,6 +211,9 @@ o("GET /$test_dir_uri/x/ HTTP/1.0\n\n", "Content-Type: text/html\r\n\r\n",
...
@@ -211,6 +211,9 @@ o("GET /$test_dir_uri/x/ HTTP/1.0\n\n", "Content-Type: text/html\r\n\r\n",
'index.cgi execution'
);
'index.cgi execution'
);
o
(
"GET /ta/x/ HTTP/1.0\n\n"
,
"SCRIPT_NAME=/ta/x/index.cgi"
,
o
(
"GET /ta/x/ HTTP/1.0\n\n"
,
"SCRIPT_NAME=/ta/x/index.cgi"
,
'Aliases SCRIPT_NAME'
);
'Aliases SCRIPT_NAME'
);
#o("GET /hello.txt HTTP/1.1\n\n GET /hello.txt HTTP/1.0\n\n",
# 'HTTP/1.1 200.+keep-alive.+HTTP/1.1 200.+close',
# 'Request pipelining', 2);
my
$mime_types
=
{
my
$mime_types
=
{
html
=>
'text/html'
,
html
=>
'text/html'
,
...
...
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