Skip to content

Commit

Permalink
Merge branch 'bz1295-trunc-post'
Browse files Browse the repository at this point in the history
  • Loading branch information
beerriot committed Nov 30, 2011
2 parents 552ac5e + b1b6cd1 commit 1149a15
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/luwak_wm_file.erl
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,8 @@ accept_streambody(RD, #ctx{handle={ok, H}, client=C, method=Method}) ->
{H2, Count} = accept_streambody1(Stream, 0, wrq:stream_req_body(RD, Size)),
H2Len = luwak_file:length(C, H2),
%% truncate will fail if passed a Start >= the length of the file
if Count < H2Len ->
{ok, _} = luwak_io:truncate(C, H2, Count),
if Offset+Count < H2Len ->
{ok, _} = luwak_io:truncate(C, H2, Offset+Count),
true;
true -> true
end.
Expand Down

0 comments on commit 1149a15

Please sign in to comment.