mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-07 03:35:34 -05:00
feat(bin): disable uploading by default
This commit is contained in:
parent
4d852f3cd3
commit
057d6401ab
1 changed files with 4 additions and 3 deletions
|
|
@ -15,7 +15,7 @@ let default_config () : config = {
|
||||||
addr="127.0.0.1";
|
addr="127.0.0.1";
|
||||||
port=8080;
|
port=8080;
|
||||||
delete=false;
|
delete=false;
|
||||||
upload=true;
|
upload=false;
|
||||||
max_upload_size = 10 * 1024 * 1024;
|
max_upload_size = 10 * 1024 * 1024;
|
||||||
j=32;
|
j=32;
|
||||||
}
|
}
|
||||||
|
|
@ -203,10 +203,11 @@ let main () =
|
||||||
"--port", Int (fun x -> config.port <- x), " port to listen on";
|
"--port", Int (fun x -> config.port <- x), " port to listen on";
|
||||||
"-p", Int (fun x -> config.port <- x), " alias to --port";
|
"-p", Int (fun x -> config.port <- x), " alias to --port";
|
||||||
"--dir", Set_string dir_, " directory to serve (default: \".\")";
|
"--dir", Set_string dir_, " directory to serve (default: \".\")";
|
||||||
|
"--debug", Unit (fun () -> S._enable_debug true), " debug mode";
|
||||||
|
"--upload", Unit (fun () -> config.upload <- true), " enable file uploading";
|
||||||
"--no-upload", Unit (fun () -> config.upload <- false), " disable file uploading";
|
"--no-upload", Unit (fun () -> config.upload <- false), " disable file uploading";
|
||||||
"--max-upload", String (fun i -> config.max_upload_size <- parse_size i),
|
"--max-upload", String (fun i -> config.max_upload_size <- parse_size i),
|
||||||
" maximum size of files that can be uploaded";
|
" maximum size of files that can be uploaded";
|
||||||
"--debug", Unit (fun () -> S._enable_debug true), " debug mode";
|
|
||||||
"--delete", Unit (fun () -> config.delete <- true), " enable `delete` on files";
|
"--delete", Unit (fun () -> config.delete <- true), " enable `delete` on files";
|
||||||
"--no-delete", Unit (fun () -> config.delete <- false), " disable `delete` on files";
|
"--no-delete", Unit (fun () -> config.delete <- false), " disable `delete` on files";
|
||||||
"-j", Int (fun j->config.j <- j), " maximum number of simultaneous connections";
|
"-j", Int (fun j->config.j <- j), " maximum number of simultaneous connections";
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue