Compare commits
No commits in common. "141e637630473088c9ef57bd5288fa8528d76430" and "7f77f9e3b19f58006df88a2a601e85835d300c37" have entirely different histories.
141e637630
...
7f77f9e3b1
11
src/qhl.erl
11
src/qhl.erl
@ -27,8 +27,7 @@
|
|||||||
-spec parse(Socket, Received) -> Result
|
-spec parse(Socket, Received) -> Result
|
||||||
when Socket :: gen_tcp:socket(),
|
when Socket :: gen_tcp:socket(),
|
||||||
Received :: binary(),
|
Received :: binary(),
|
||||||
Result :: {ok, #request{}, Next} | {error, Reason},
|
Result :: {ok, #request{}} | {error, Reason},
|
||||||
Next :: none | binary(),
|
|
||||||
Reason :: term(). % FIXME
|
Reason :: term(). % FIXME
|
||||||
%% @doc
|
%% @doc
|
||||||
%% @equiv parse(Socket, Received, #request{})
|
%% @equiv parse(Socket, Received, #request{})
|
||||||
@ -41,17 +40,13 @@ parse(Socket, Received) ->
|
|||||||
when Socket :: gen_tcp:socket(),
|
when Socket :: gen_tcp:socket(),
|
||||||
Received :: binary(),
|
Received :: binary(),
|
||||||
Request :: #request{},
|
Request :: #request{},
|
||||||
Result :: {ok, #request{}, Next} | {error, Reason},
|
Result :: {ok, #request{}} | {error, Reason},
|
||||||
Next :: none | binary(),
|
|
||||||
Reason :: term(). % FIXME
|
Reason :: term(). % FIXME
|
||||||
%% @doc
|
%5 @doc
|
||||||
%% Pass this function the connection socket and whatever the receive loop has acquired,
|
%% 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
|
%% 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
|
%% the `http.hrl' and set `{mode, binary}' and `{active, once}' options on the
|
||||||
%% socket.
|
%% 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}) ->
|
parse(Socket, Received, M = #request{method = undefined}) ->
|
||||||
case read_method(Socket, Received) of
|
case read_method(Socket, Received) of
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user