This is an automated email from the ASF dual-hosted git repository. willholley pushed a commit to branch upstream-2.20.0 in repository https://gitbox.apache.org/repos/asf/couchdb-mochiweb.git
commit 763fa5269b75caab5d0bd760137e267bf85d0311 Author: Bob Ippolito <[email protected]> AuthorDate: Sat Mar 9 20:53:33 2019 +0000 Remove compile(tuple_calls) from mochiweb_response --- src/mochiweb_response.erl | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/mochiweb_response.erl b/src/mochiweb_response.erl index dc9569e..81325b5 100644 --- a/src/mochiweb_response.erl +++ b/src/mochiweb_response.erl @@ -24,8 +24,6 @@ -module(mochiweb_response). -author('[email protected]'). --compile(tuple_calls). - -define(QUIP, "Any of you quaids got a smint?"). -export([new/3, get_header_value/2, get/2, dump/1]). @@ -56,26 +54,26 @@ get(headers, {?MODULE, [_Request, _Code, Headers]}) -> %% @spec dump(response()) -> {mochiweb_request, [{atom(), term()}]} %% @doc Dump the internal representation to a "human readable" set of terms %% for debugging/inspection purposes. -dump({?MODULE, [Request, Code, Headers]}) -> - [{request, Request:dump()}, +dump({?MODULE, [{ReqM, _} = Request, Code, Headers]}) -> + [{request, ReqM:dump(Request)}, {code, Code}, {headers, mochiweb_headers:to_list(Headers)}]. %% @spec send(iodata(), response()) -> ok %% @doc Send data over the socket if the method is not HEAD. -send(Data, {?MODULE, [Request, _Code, _Headers]}) -> - case Request:get(method) of +send(Data, {?MODULE, [{ReqM, _} = Request, _Code, _Headers]}) -> + case ReqM:get(method, Request) of 'HEAD' -> ok; _ -> - Request:send(Data) + ReqM:send(Data, Request) end. %% @spec write_chunk(iodata(), response()) -> ok %% @doc Write a chunk of a HTTP chunked response. If Data is zero length, %% then the chunked response will be finished. -write_chunk(Data, {?MODULE, [Request, _Code, _Headers]}=THIS) -> - case Request:get(version) of +write_chunk(Data, {?MODULE, [{ReqM, _} = Request, _Code, _Headers]}=THIS) -> + case ReqM:get(version, Request) of Version when Version >= {1, 1} -> Length = iolist_size(Data), send([io_lib:format("~.16b\r\n", [Length]), Data, <<"\r\n">>], THIS);
