Compare commits
4 Commits
faf14bac3f
...
23261552e1
| Author | SHA1 | Date | |
|---|---|---|---|
| 23261552e1 | |||
| 141e637630 | |||
|
|
62b95f13fe | ||
|
|
5002127580 |
11
src/qhl.erl
11
src/qhl.erl
@ -27,7 +27,8 @@
|
|||||||
-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{}} | {error, Reason},
|
Result :: {ok, #request{}, Next} | {error, Reason},
|
||||||
|
Next :: none | binary(),
|
||||||
Reason :: term(). % FIXME
|
Reason :: term(). % FIXME
|
||||||
%% @doc
|
%% @doc
|
||||||
%% @equiv parse(Socket, Received, #request{})
|
%% @equiv parse(Socket, Received, #request{})
|
||||||
@ -40,13 +41,17 @@ parse(Socket, Received) ->
|
|||||||
when Socket :: gen_tcp:socket(),
|
when Socket :: gen_tcp:socket(),
|
||||||
Received :: binary(),
|
Received :: binary(),
|
||||||
Request :: #request{},
|
Request :: #request{},
|
||||||
Result :: {ok, #request{}} | {error, Reason},
|
Result :: {ok, #request{}, Next} | {error, Reason},
|
||||||
|
Next :: none | binary(),
|
||||||
Reason :: term(). % FIXME
|
Reason :: term(). % FIXME
|
||||||
%5 @doc
|
%% @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