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
e0b61092
Commit
e0b61092
authored
Jan 11, 2014
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added -DNO_FILESYSTEM
parent
d29f8496
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
208 additions
and
173 deletions
+208
-173
main.c
build/main.c
+10
-4
mongoose.c
mongoose.c
+198
-169
No files found.
build/main.c
View file @
e0b61092
...
@@ -120,7 +120,9 @@ static void show_usage_and_exit(void) {
...
@@ -120,7 +120,9 @@ static void show_usage_and_exit(void) {
fprintf
(
stderr
,
"Mongoose version %s (c) Sergey Lyubka, built on %s
\n
"
,
fprintf
(
stderr
,
"Mongoose version %s (c) Sergey Lyubka, built on %s
\n
"
,
MONGOOSE_VERSION
,
__DATE__
);
MONGOOSE_VERSION
,
__DATE__
);
fprintf
(
stderr
,
"Usage:
\n
"
);
fprintf
(
stderr
,
"Usage:
\n
"
);
#ifndef NO_AUTH
fprintf
(
stderr
,
" mongoose -A <htpasswd_file> <realm> <user> <passwd>
\n
"
);
fprintf
(
stderr
,
" mongoose -A <htpasswd_file> <realm> <user> <passwd>
\n
"
);
#endif
fprintf
(
stderr
,
" mongoose [config_file]
\n
"
);
fprintf
(
stderr
,
" mongoose [config_file]
\n
"
);
fprintf
(
stderr
,
" mongoose [-option value ...]
\n
"
);
fprintf
(
stderr
,
" mongoose [-option value ...]
\n
"
);
fprintf
(
stderr
,
"
\n
OPTIONS:
\n
"
);
fprintf
(
stderr
,
"
\n
OPTIONS:
\n
"
);
...
@@ -142,7 +144,7 @@ static const char *config_file_top_comment =
...
@@ -142,7 +144,7 @@ static const char *config_file_top_comment =
"# To make a change, remove leading '#', modify option's value,
\n
"
"# To make a change, remove leading '#', modify option's value,
\n
"
"# save this file and then restart Mongoose.
\n\n
"
;
"# save this file and then restart Mongoose.
\n\n
"
;
static
const
char
*
get_url_to_
first_open_port
(
const
struct
mg_server
*
server
)
{
static
const
char
*
get_url_to_
me
(
const
struct
mg_server
*
server
)
{
static
char
url
[
100
];
static
char
url
[
100
];
const
char
*
s
=
mg_get_option
(
server
,
"listening_port"
);
const
char
*
s
=
mg_get_option
(
server
,
"listening_port"
);
const
char
*
cert
=
mg_get_option
(
server
,
"ssl_certificate"
);
const
char
*
cert
=
mg_get_option
(
server
,
"ssl_certificate"
);
...
@@ -335,6 +337,7 @@ static void set_absolute_path(char *options[], const char *option_name,
...
@@ -335,6 +337,7 @@ static void set_absolute_path(char *options[], const char *option_name,
}
}
}
}
#ifndef NO_AUTH
int
modify_passwords_file
(
const
char
*
fname
,
const
char
*
domain
,
int
modify_passwords_file
(
const
char
*
fname
,
const
char
*
domain
,
const
char
*
user
,
const
char
*
pass
)
{
const
char
*
user
,
const
char
*
pass
)
{
int
found
;
int
found
;
...
@@ -397,6 +400,7 @@ int modify_passwords_file(const char *fname, const char *domain,
...
@@ -397,6 +400,7 @@ int modify_passwords_file(const char *fname, const char *domain,
return
1
;
return
1
;
}
}
#endif
static
void
start_mongoose
(
int
argc
,
char
*
argv
[])
{
static
void
start_mongoose
(
int
argc
,
char
*
argv
[])
{
char
*
options
[
MAX_OPTIONS
];
char
*
options
[
MAX_OPTIONS
];
...
@@ -406,6 +410,7 @@ static void start_mongoose(int argc, char *argv[]) {
...
@@ -406,6 +410,7 @@ static void start_mongoose(int argc, char *argv[]) {
die
(
"%s"
,
"Failed to start Mongoose."
);
die
(
"%s"
,
"Failed to start Mongoose."
);
}
}
#ifndef NO_AUTH
// Edit passwords file if -A option is specified
// Edit passwords file if -A option is specified
if
(
argc
>
1
&&
!
strcmp
(
argv
[
1
],
"-A"
))
{
if
(
argc
>
1
&&
!
strcmp
(
argv
[
1
],
"-A"
))
{
if
(
argc
!=
6
)
{
if
(
argc
!=
6
)
{
...
@@ -414,6 +419,7 @@ static void start_mongoose(int argc, char *argv[]) {
...
@@ -414,6 +419,7 @@ static void start_mongoose(int argc, char *argv[]) {
exit
(
modify_passwords_file
(
argv
[
2
],
argv
[
3
],
argv
[
4
],
argv
[
5
])
?
exit
(
modify_passwords_file
(
argv
[
2
],
argv
[
3
],
argv
[
4
],
argv
[
5
])
?
EXIT_SUCCESS
:
EXIT_FAILURE
);
EXIT_SUCCESS
:
EXIT_FAILURE
);
}
}
#endif
// Show usage if -h or --help options are specified
// Show usage if -h or --help options are specified
if
(
argc
==
2
&&
(
!
strcmp
(
argv
[
1
],
"-h"
)
||
!
strcmp
(
argv
[
1
],
"--help"
)))
{
if
(
argc
==
2
&&
(
!
strcmp
(
argv
[
1
],
"-h"
)
||
!
strcmp
(
argv
[
1
],
"--help"
)))
{
...
@@ -882,8 +888,8 @@ static LRESULT CALLBACK WindowProc(HWND hWnd, UINT msg, WPARAM wParam,
...
@@ -882,8 +888,8 @@ static LRESULT CALLBACK WindowProc(HWND hWnd, UINT msg, WPARAM wParam,
manage_service
(
LOWORD
(
wParam
));
manage_service
(
LOWORD
(
wParam
));
break
;
break
;
case
ID_CONNECT
:
case
ID_CONNECT
:
printf
(
"[%s]
\n
"
,
get_url_to_
first_open_port
(
server
));
printf
(
"[%s]
\n
"
,
get_url_to_
me
(
server
));
ShellExecute
(
NULL
,
"open"
,
get_url_to_
first_open_port
(
server
),
ShellExecute
(
NULL
,
"open"
,
get_url_to_
me
(
server
),
NULL
,
NULL
,
SW_SHOW
);
NULL
,
NULL
,
SW_SHOW
);
break
;
break
;
}
}
...
@@ -980,7 +986,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR cmdline, int show) {
...
@@ -980,7 +986,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR cmdline, int show) {
-
(
void
)
openBrowser
{
-
(
void
)
openBrowser
{
[[
NSWorkspace
sharedWorkspace
]
[[
NSWorkspace
sharedWorkspace
]
openURL
:
[
NSURL
URLWithString
:
openURL
:
[
NSURL
URLWithString
:
[
NSString
stringWithUTF8String
:
get_url_to_
first_open_port
(
server
)]]];
[
NSString
stringWithUTF8String
:
get_url_to_
me
(
server
)]]];
}
}
-
(
void
)
editConfig
{
-
(
void
)
editConfig
{
create_config_file
(
config_file
);
create_config_file
(
config_file
);
...
...
mongoose.c
View file @
e0b61092
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