Using disk file to store large request body.
This closes #386 on GitHub.
This commit is contained in:
@@ -693,6 +693,7 @@ nxt_runtime_conf_init(nxt_task_t *task, nxt_runtime_t *rt)
|
||||
rt->modules = NXT_MODULES;
|
||||
rt->state = NXT_STATE;
|
||||
rt->control = NXT_CONTROL_SOCK;
|
||||
rt->tmp = NXT_TMP;
|
||||
|
||||
nxt_memzero(&rt->capabilities, sizeof(nxt_capabilities_t));
|
||||
|
||||
@@ -835,6 +836,7 @@ nxt_runtime_conf_read_cmd(nxt_task_t *task, nxt_runtime_t *rt)
|
||||
static const char no_modules[] =
|
||||
"option \"--modules\" requires directory\n";
|
||||
static const char no_state[] = "option \"--state\" requires directory\n";
|
||||
static const char no_tmp[] = "option \"--tmp\" requires directory\n";
|
||||
|
||||
static const char help[] =
|
||||
"\n"
|
||||
@@ -859,6 +861,9 @@ nxt_runtime_conf_read_cmd(nxt_task_t *task, nxt_runtime_t *rt)
|
||||
" --state DIRECTORY set state directory name\n"
|
||||
" default: \"" NXT_STATE "\"\n"
|
||||
"\n"
|
||||
" --tmp DIRECTORY set tmp directory name\n"
|
||||
" default: \"" NXT_TMP "\"\n"
|
||||
"\n"
|
||||
" --user USER set non-privileged processes to run"
|
||||
" as specified user\n"
|
||||
" default: \"" NXT_USER "\"\n"
|
||||
@@ -966,6 +971,19 @@ nxt_runtime_conf_read_cmd(nxt_task_t *task, nxt_runtime_t *rt)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (nxt_strcmp(p, "--tmp") == 0) {
|
||||
if (*argv == NULL) {
|
||||
write(STDERR_FILENO, no_tmp, nxt_length(no_tmp));
|
||||
return NXT_ERROR;
|
||||
}
|
||||
|
||||
p = *argv++;
|
||||
|
||||
rt->tmp = p;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (nxt_strcmp(p, "--no-daemon") == 0) {
|
||||
rt->daemon = 0;
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user