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
d9f9911d
Commit
d9f9911d
authored
Sep 15, 2012
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed max request size from options, moved to the #define
parent
93b45625
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
mongoose.c
mongoose.c
+4
-5
No files found.
mongoose.c
View file @
d9f9911d
...
@@ -228,6 +228,7 @@ typedef int SOCKET;
...
@@ -228,6 +228,7 @@ typedef int SOCKET;
#define CGI_ENVIRONMENT_SIZE 4096
#define CGI_ENVIRONMENT_SIZE 4096
#define MAX_CGI_ENVIR_VARS 64
#define MAX_CGI_ENVIR_VARS 64
#define MG_BUF_LEN 8192
#define MG_BUF_LEN 8192
#define MAX_REQUEST_SIZE 16384
#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
#ifdef _WIN32
#ifdef _WIN32
...
@@ -427,7 +428,7 @@ struct socket {
...
@@ -427,7 +428,7 @@ struct socket {
// NOTE(lsm): this enum shoulds be in sync with the config_options below.
// NOTE(lsm): this enum shoulds be in sync with the config_options below.
enum
{
enum
{
CGI_EXTENSIONS
,
CGI_ENVIRONMENT
,
PUT_DELETE_PASSWORDS_FILE
,
CGI_INTERPRETER
,
CGI_EXTENSIONS
,
CGI_ENVIRONMENT
,
PUT_DELETE_PASSWORDS_FILE
,
CGI_INTERPRETER
,
MAX_REQUEST_SIZE
,
PROTECT_URI
,
AUTHENTICATION_DOMAIN
,
SSI_EXTENSIONS
,
PROTECT_URI
,
AUTHENTICATION_DOMAIN
,
SSI_EXTENSIONS
,
ACCESS_LOG_FILE
,
SSL_CHAIN_FILE
,
ENABLE_DIRECTORY_LISTING
,
ERROR_LOG_FILE
,
ACCESS_LOG_FILE
,
SSL_CHAIN_FILE
,
ENABLE_DIRECTORY_LISTING
,
ERROR_LOG_FILE
,
GLOBAL_PASSWORDS_FILE
,
INDEX_FILES
,
ENABLE_KEEP_ALIVE
,
ACCESS_CONTROL_LIST
,
GLOBAL_PASSWORDS_FILE
,
INDEX_FILES
,
ENABLE_KEEP_ALIVE
,
ACCESS_CONTROL_LIST
,
EXTRA_MIME_TYPES
,
LISTENING_PORTS
,
DOCUMENT_ROOT
,
SSL_CERTIFICATE
,
EXTRA_MIME_TYPES
,
LISTENING_PORTS
,
DOCUMENT_ROOT
,
SSL_CERTIFICATE
,
...
@@ -440,7 +441,6 @@ static const char *config_options[] = {
...
@@ -440,7 +441,6 @@ static const char *config_options[] = {
"E"
,
"cgi_environment"
,
NULL
,
"E"
,
"cgi_environment"
,
NULL
,
"G"
,
"put_delete_passwords_file"
,
NULL
,
"G"
,
"put_delete_passwords_file"
,
NULL
,
"I"
,
"cgi_interpreter"
,
NULL
,
"I"
,
"cgi_interpreter"
,
NULL
,
"M"
,
"max_request_size"
,
"16384"
,
"P"
,
"protect_uri"
,
NULL
,
"P"
,
"protect_uri"
,
NULL
,
"R"
,
"authentication_domain"
,
"mydomain.com"
,
"R"
,
"authentication_domain"
,
"mydomain.com"
,
"S"
,
"ssi_pattern"
,
"**.shtml$|**.shtm$"
,
"S"
,
"ssi_pattern"
,
"**.shtml$|**.shtm$"
,
...
@@ -4182,13 +4182,12 @@ static int consume_socket(struct mg_context *ctx, struct socket *sp) {
...
@@ -4182,13 +4182,12 @@ static int consume_socket(struct mg_context *ctx, struct socket *sp) {
static
void
worker_thread
(
struct
mg_context
*
ctx
)
{
static
void
worker_thread
(
struct
mg_context
*
ctx
)
{
struct
mg_connection
*
conn
;
struct
mg_connection
*
conn
;
int
buf_size
=
atoi
(
ctx
->
config
[
MAX_REQUEST_SIZE
]);
conn
=
(
struct
mg_connection
*
)
calloc
(
1
,
sizeof
(
*
conn
)
+
buf_size
);
conn
=
(
struct
mg_connection
*
)
calloc
(
1
,
sizeof
(
*
conn
)
+
MAX_REQUEST_SIZE
);
if
(
conn
==
NULL
)
{
if
(
conn
==
NULL
)
{
cry
(
fc
(),
"%s"
,
"Cannot create new connection struct, OOM"
);
cry
(
fc
(),
"%s"
,
"Cannot create new connection struct, OOM"
);
}
else
{
}
else
{
conn
->
buf_size
=
buf_size
;
conn
->
buf_size
=
MAX_REQUEST_SIZE
;
conn
->
buf
=
(
char
*
)
(
conn
+
1
);
conn
->
buf
=
(
char
*
)
(
conn
+
1
);
// Call consume_socket() even when ctx->stop_flag > 0, to let it signal
// Call consume_socket() even when ctx->stop_flag > 0, to let it signal
...
...
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