Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

changed behavior of 'POST' method, now append data to the end of the …

…object
  • Loading branch information...
commit 5fc74c3f68e6bf12aad8d4ec5e66f536f8db17a6 1 parent 2dc13c5
Alex T authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/luwak_wm_file.erl
View
8 src/luwak_wm_file.erl
@@ -502,8 +502,12 @@ accept_doc_body(RD, Ctx=#ctx{key=K, client=C}) ->
HCtx = Ctx#ctx{handle={ok,H1}},
{accept_streambody(RD, HCtx), RD, HCtx}.
-accept_streambody(RD, #ctx{handle={ok, H}, client=C}) ->
- Stream = luwak_put_stream:start_link(C, H, 0, 1000),
+accept_streambody(RD, #ctx{handle={ok, H}, client=C, method=Method}) ->
+ Offset = case Method of
+ 'POST' -> luwak_file:length(C,H);
+ _ ->0
+ end,
+ Stream = luwak_put_stream:start_link(C, H, Offset, 1000),
Size = luwak_file:get_default_block_size(),
accept_streambody1(Stream, 0, wrq:stream_req_body(RD, Size)).
Please sign in to comment.
Something went wrong with that request. Please try again.