anchor.diff:  	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).
  
positive.code:     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) ->
  
negative.code: 
  send_response(Code, ReqData) ->
      Body0 = wrq:resp_body(ReqData),
      {Body, Transfer, Length} = case Body0 of
          {stream, StreamBody} -> {{stream, StreamBody}, chunked, undefined};
          {writer, WriteBody} -> {{writer, WriteBody}, chunked, undefined};
          {stream, StreamBody, KnownLength} -> {{stream, StreamBody}, chunked, KnownLength};
          {writer, WriteBody, KnownLength} -> {{writer, WriteBody}, chunked, KnownLength};
          _ -> {Body0, undefined, iolist_size([Body0])}
      end,
      send(ReqData#wm_reqdata.socket,
          [make_version(wrq:version(ReqData)),
           make_code(Code), <<"\r\n">> | 
           make_headers(Code, Transfer, Length, ReqData)]),
      FinalLength = case wrq:method(ReqData) of 
  	'HEAD' ->
  	    Length;
  	_ -> 
          case Body of
              {stream, Body2} ->
                  send_stream_body(ReqData#wm_reqdata.socket, is_chunked_transfer(wrq:version(ReqData), Transfer), Body2);
              {writer, Body2} ->
                  send_writer_body(ReqData#wm_reqdata.socket, is_chunked_transfer(wrq:version(ReqData), Transfer), Body2);
              _ ->
                  send(ReqData#wm_reqdata.socket, Body),
                  Length
  