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
956788d7
Commit
956788d7
authored
Jan 24, 2014
by
Andrea Guzzo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed mg_get_mime_type to expect the default type as argument
instead of using a configuration option
parent
45f66120
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
mongoose.c
mongoose.c
+3
-5
mongoose.h
mongoose.h
+1
-1
No files found.
mongoose.c
View file @
956788d7
...
...
@@ -220,7 +220,6 @@ enum {
CGI_PATTERN
,
DAV_AUTH_FILE
,
DOCUMENT_ROOT
,
ENABLE_DIRECTORY_LISTING
,
#endif
EXTRA_MIME_TYPES
,
DEFAULT_MIME_TYPE
,
#ifndef MONGOOSE_NO_FILESYSTEM
GLOBAL_AUTH_FILE
,
#endif
...
...
@@ -250,7 +249,6 @@ static const char *static_config_options[] = {
"enable_directory_listing"
,
"yes"
,
#endif
"extra_mime_types"
,
NULL
,
"default_mime_type"
,
"text/plain"
,
#ifndef MONGOOSE_NO_FILESYSTEM
"global_auth_file"
,
NULL
,
#endif
...
...
@@ -1995,7 +1993,7 @@ static void write_to_socket(struct connection *conn) {
}
}
const
char
*
mg_get_mime_type
(
struct
mg_server
*
server
,
const
char
*
path
)
{
const
char
*
mg_get_mime_type
(
const
char
*
path
,
const
char
*
default_mime_type
)
{
const
char
*
ext
;
size_t
i
,
path_len
;
...
...
@@ -2009,7 +2007,7 @@ const char *mg_get_mime_type(struct mg_server *server, const char *path) {
}
}
return
server
->
config_options
[
DEFAULT_MIME_TYPE
]
;
return
default_mime_type
;
}
static
struct
uri_handler
*
find_uri_handler
(
struct
mg_server
*
server
,
...
...
@@ -2095,7 +2093,7 @@ static void get_mime_type(const struct mg_server *server, const char *path,
}
}
vec
->
ptr
=
mg_get_mime_type
(
(
struct
mg_server
*
)
server
,
path
);
vec
->
ptr
=
mg_get_mime_type
(
path
,
"text/plain"
);
vec
->
len
=
strlen
(
vec
->
ptr
);
}
...
...
mongoose.h
View file @
956788d7
...
...
@@ -86,7 +86,7 @@ int mg_printf(struct mg_connection *conn, const char *fmt, ...);
const
char
*
mg_get_header
(
const
struct
mg_connection
*
,
const
char
*
name
);
const
char
*
mg_get_mime_type
(
struct
mg_server
*
,
const
char
*
file_nam
e
);
const
char
*
mg_get_mime_type
(
const
char
*
file_name
,
const
char
*
default_mime_typ
e
);
int
mg_get_var
(
const
struct
mg_connection
*
conn
,
const
char
*
var_name
,
char
*
buf
,
size_t
buf_len
);
int
mg_parse_header
(
const
char
*
hdr
,
const
char
*
var_name
,
char
*
buf
,
size_t
);
...
...
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