Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion master/rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{plists, "",
{git, "https://github.com/discoproject/plists", {branch, "master"}}},
{mochiweb, ".*",
{git, "https://github.com/mochi/mochiweb.git", {tag, "v2.9.2"}}}]}.
{git, "https://github.com/mochi/mochiweb.git", b66b68d95c9e1b2a32b194202e870e6d1e232eb7 }}]}.
{xref_checks,
% Remove 'exports_not_used' from default xref_checks since lager trips it.
[undefined_function_calls]}.
5 changes: 3 additions & 2 deletions master/src/ddfs/ddfs_put.erl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

% maximum file size: 1T
-define(MAX_RECV_BODY, (1024*1024*1024*1024)).
-define(RECV_CHUNK, (8192)).

-spec start(non_neg_integer()) -> {ok, pid()} | {error, term()}.
start(Port) ->
Expand Down Expand Up @@ -109,13 +110,13 @@ receive_blob(Req, IO, Dst, Url) ->

-spec receive_body(module(), file:io_device()) -> _.
receive_body(Req, IO) ->
R0 = (catch Req:stream_body(?MAX_RECV_BODY,
R0 = (catch Req:stream_body(?RECV_CHUNK,
fun ({BufLen, Buf}, BodyLen) ->
case file:write(IO, Buf) of
ok -> BodyLen + BufLen;
{error, _E} = Err -> throw(Err)
end
end, 0)),
end, 0,?MAX_RECV_BODY)),
case R0 of
% R == <<>> or undefined if body is empty
R when is_integer(R); R =:= <<>>; R =:= undefined ->
Expand Down
3 changes: 2 additions & 1 deletion master/src/ddfs/ddfs_util.erl
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ start_web(Port, Func, Name) ->
Ret = mochiweb_http:start([{name, Name},
{max, ?HTTP_MAX_CONNS},
{loop, Func},
{port, Port}]),
{port, Port},
{recbuf,undefined}]),
case Ret of
{ok, _Pid} -> error_logger:info_msg("Started ~p at ~p on port ~p",
[Name, node(), Port]);
Expand Down