anchor.diff:      FinalLogData = InitLogData#wm_log_data{response_code=Code,response_length=FinalLength},
       ReqData1 = wrq:set_response_code(Code, ReqData),
       {ok, ReqData1#wm_reqdata{log_data=FinalLogData}}.
  +    
  +
   
   %% @doc  Infer body length from transfer-encoding and content-length headers.
   body_length(ReqData) ->
  
positive.code: 	_ -> exit(normal)
      end.
  
  send_stream_body(Socket, X) -> send_stream_body(Socket, X, 0).
  send_stream_body(Socket, {<<>>, done}, SoFar) ->
      send_chunk(Socket, <<>>),
      SoFar;
  send_stream_body(Socket, {Data, done}, SoFar) ->
      Size = send_chunk(Socket, Data),
      send_chunk(Socket, <<>>),
      Size + SoFar;
  send_stream_body(Socket, {<<>>, Next}, SoFar) ->
      send_stream_body(Socket, Next(), SoFar);
  send_stream_body(Socket, {[], Next}, SoFar) ->
      send_stream_body(Socket, Next(), SoFar);
  send_stream_body(Socket, {Data, Next}, SoFar) ->
      Size = send_chunk(Socket, Data),
      send_stream_body(Socket, Next(), Size + SoFar).
  
  
  %% @todo Remove usage of the put/get to get the number of bytes written
  %%       Use a separate process to accumulate these counts
  send_writer_body(Socket, {Encoder, Charsetter, BodyFun}) ->
      put(bytes_written, 0),
      Writer = fun(Data) ->
          Size = send_chunk(Socket, Encoder(Charsetter(Data))),
          put(bytes_written, get(bytes_written) + Size),
          Size
      end,
      BodyFun(Writer),
      send_chunk(Socket, <<>>),
      get(bytes_written).
  
  
  %% @todo Distinguish between HTTP/1.0 and 1.1
  %%       HTTP/1.0 should not add the size (and transfer-encoding: chunked)
  send_chunk(Socket, Data) ->
      Size = iolist_size(Data),
      send(Socket, mochihex:to_hex(Size)),
      send(Socket, <<"\r\n">>),
      send(Socket, Data),
      send(Socket, <<"\r\n">>),
      Size.
  
  
  
negative.code: 	end,
      lists:foldl(F, [<<"\r\n">>], mochiweb_headers:to_list(Hdrs)).
  
  
  is_chunked_transfer(HttpVersion, chunked) when HttpVersion > {1,0} -> true;
  is_chunked_transfer(_, _) -> false.
  
  
  socket(ReqData) -> ReqData#wm_reqdata.socket.
  
  method(ReqData) -> wrq:method(ReqData).
  