From b01448fdf32eff36d6db688d21c138a1cf81eacc Mon Sep 17 00:00:00 2001 From: Martin Sumner Date: Fri, 8 Feb 2019 15:48:16 +0000 Subject: [PATCH 1/4] Point at new mochiweb Version of mochiweb with which we intend to deploy configurable buffer support --- rebar.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rebar.config b/rebar.config index 8e5147e9..e84ab969 100644 --- a/rebar.config +++ b/rebar.config @@ -6,7 +6,7 @@ {xref_checks, [undefined_function_calls]}. {deps, - [{mochiweb, "2.9.0.*", {git, "git://github.com/basho/mochiweb.git", {tag, "v2.9.0p2"}}} + [{mochiweb, ".*", {git, "git://github.com/basho/mochiweb.git", {branch, "develop-2.9"}}} ]}. {dev_only_deps, From 7ee06c63aec058d4c782edc2407ab6bcc44504aa Mon Sep 17 00:00:00 2001 From: Martin Sumner Date: Fri, 8 Feb 2019 17:52:42 +0000 Subject: [PATCH 2/4] Update rebar.config mochiweb develop-2.9 not yet on basho repo --- rebar.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rebar.config b/rebar.config index e84ab969..6f6c7b4b 100644 --- a/rebar.config +++ b/rebar.config @@ -6,7 +6,7 @@ {xref_checks, [undefined_function_calls]}. {deps, - [{mochiweb, ".*", {git, "git://github.com/basho/mochiweb.git", {branch, "develop-2.9"}}} + [{mochiweb, ".*", {git, "git://github.com/martinsumner/mochiweb.git", {branch, "develop-2.9"}}} ]}. {dev_only_deps, From 7765e899f83c2d46bcd451a2654c1ff25002f3c8 Mon Sep 17 00:00:00 2001 From: Martin Sumner Date: Mon, 11 Feb 2019 11:45:51 +0000 Subject: [PATCH 3/4] Add capability to pass recbuf option into mochiweb To handle issue with headers which are larger than the default receive buffer, can start with a larger receive buffer --- src/webmachine_mochiweb.erl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/webmachine_mochiweb.erl b/src/webmachine_mochiweb.erl index 43a864ed..046df2fa 100644 --- a/src/webmachine_mochiweb.erl +++ b/src/webmachine_mochiweb.erl @@ -30,7 +30,14 @@ -define (WM_OPTION_DEFAULTS, [{error_handler, webmachine_error_handler}]). start(Options) -> - {DispatchList, PName, DGroup, WMOptions, OtherOptions} = get_wm_options(Options), + {DispatchList, PName, DGroup, WMOptions, OtherOptions0} = get_wm_options(Options), + OtherOptions = + case application:get_env(webmachine, recbuf) of + {ok, RecBuf} -> + [{recbuf, RecBuf}|OtherOptions0]; + _ -> + OtherOptions0 + end, webmachine_router:init_routes(DGroup, DispatchList), _ = [application_set_unless_env_or_undef(K, V) || {K, V} <- WMOptions], MochiName = list_to_atom(to_list(PName) ++ "_mochiweb"), From 070daa6af38620db95a6fe392af5a70992ffa3d9 Mon Sep 17 00:00:00 2001 From: Martin Sumner Date: Mon, 11 Feb 2019 11:53:50 +0000 Subject: [PATCH 4/4] Update rebar.config Point back at basho repo --- rebar.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rebar.config b/rebar.config index 6f6c7b4b..e84ab969 100644 --- a/rebar.config +++ b/rebar.config @@ -6,7 +6,7 @@ {xref_checks, [undefined_function_calls]}. {deps, - [{mochiweb, ".*", {git, "git://github.com/martinsumner/mochiweb.git", {branch, "develop-2.9"}}} + [{mochiweb, ".*", {git, "git://github.com/basho/mochiweb.git", {branch, "develop-2.9"}}} ]}. {dev_only_deps,