Compare commits

..

No commits in common. "23261552e1278cabe2586dc44fb5d2b828f03d22" and "faf14bac3fe223051de602eb28c952271cacbac4" have entirely different histories.

View File

@ -27,8 +27,7 @@
-spec parse(Socket, Received) -> Result
when Socket :: gen_tcp:socket(),
Received :: binary(),
Result :: {ok, #request{}, Next} | {error, Reason},
Next :: none | binary(),
Result :: {ok, #request{}} | {error, Reason},
Reason :: term(). % FIXME
%% @doc
%% @equiv parse(Socket, Received, #request{})
@ -41,17 +40,13 @@ parse(Socket, Received) ->
when Socket :: gen_tcp:socket(),
Received :: binary(),
Request :: #request{},
Result :: {ok, #request{}, Next} | {error, Reason},
Next :: none | binary(),
Result :: {ok, #request{}} | {error, Reason},
Reason :: term(). % FIXME
%% @doc
%5 @doc
%% Pass this function the connection socket and whatever the receive loop has acquired,
%% and receive back a parsed #request{} record. This requires that you have imported
%% the `http.hrl' and set `{mode, binary}' and `{active, once}' options on the
%% socket.
%%
%% `Next' is any additional binary data found on the socket after a valid
%% request is parsed (presumably the beginning of a sequential request).
parse(Socket, Received, M = #request{method = undefined}) ->
case read_method(Socket, Received) of