Skip to content

Commit

Permalink
put incoming req_body in process dict
Browse files Browse the repository at this point in the history
(there is really no other decent way to allow more than one
call to wrq:req_body in the same resource fun anymore)
  • Loading branch information
justin@basho.com committed Dec 21, 2009
1 parent a9cdc36 commit f9c882e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/webmachine_request.erl
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,15 @@ call({req_body, MaxRecvBody}) ->
{ReqState#wm_reqstate.reqbody, ReqState};
undefined ->
RD=(ReqState#wm_reqstate.reqdata)#wm_reqdata{
max_recv_body=MaxRecvBody},
max_recv_body=MaxRecvBody},
NewReqState=ReqState#wm_reqstate{reqdata=RD},
NewBody = do_recv_body(NewReqState),
NewBody = case get(req_body) of
undefined ->
NewB = do_recv_body(NewReqState),
put(req_body, NewB),
NewB;
B -> B
end,
NewRD = RD#wm_reqdata{req_body=NewBody},
{NewBody, NewReqState#wm_reqstate{
bodyfetch=standard,reqdata=NewRD,reqbody=NewBody}}
Expand Down

0 comments on commit f9c882e

Please sign in to comment.