diff options
author | Loïc Hoguin <[email protected]> | 2015-02-01 19:36:13 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2015-02-03 18:54:26 +0100 |
commit | 3cede06283a2b7b33ec822526341a9261574a2bf (patch) | |
tree | 4bfbb99282926f163b19f696c615a811f80ad403 /src/cowboy_protocol.erl | |
parent | 41ac668ac771eb84f21c335810d946c2557acabd (diff) | |
download | cowboy-3cede06283a2b7b33ec822526341a9261574a2bf.tar.gz cowboy-3cede06283a2b7b33ec822526341a9261574a2bf.tar.bz2 cowboy-3cede06283a2b7b33ec822526341a9261574a2bf.zip |
Use cowlib master
Diffstat (limited to 'src/cowboy_protocol.erl')
-rw-r--r-- | src/cowboy_protocol.erl | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/cowboy_protocol.erl b/src/cowboy_protocol.erl index 558dcc3..b1cdc3a 100644 --- a/src/cowboy_protocol.erl +++ b/src/cowboy_protocol.erl @@ -55,6 +55,7 @@ }). -include_lib("cowlib/include/cow_inline.hrl"). +-include_lib("cowlib/include/cow_parse.hrl"). %% API. @@ -264,13 +265,12 @@ match_colon(<< _, Rest/bits >>, N) -> match_colon(_, _) -> nomatch. +parse_hd_name(<< $:, Rest/bits >>, S, M, P, Q, V, H, SoFar) -> + parse_hd_before_value(Rest, S, M, P, Q, V, H, SoFar); +parse_hd_name(<< C, Rest/bits >>, S, M, P, Q, V, H, SoFar) when ?IS_WS(C) -> + parse_hd_name_ws(Rest, S, M, P, Q, V, H, SoFar); parse_hd_name(<< C, Rest/bits >>, S, M, P, Q, V, H, SoFar) -> - case C of - $: -> parse_hd_before_value(Rest, S, M, P, Q, V, H, SoFar); - $\s -> parse_hd_name_ws(Rest, S, M, P, Q, V, H, SoFar); - $\t -> parse_hd_name_ws(Rest, S, M, P, Q, V, H, SoFar); - ?INLINE_LOWERCASE(parse_hd_name, Rest, S, M, P, Q, V, H, SoFar) - end. + ?LOWER(parse_hd_name, Rest, S, M, P, Q, V, H, SoFar). parse_hd_name_ws(<< C, Rest/bits >>, S, M, P, Q, V, H, Name) -> case C of @@ -429,9 +429,7 @@ parse_host(<< $:, Rest/bits >>, false, Acc) -> parse_host(<< $], Rest/bits >>, true, Acc) -> parse_host(Rest, false, << Acc/binary, $] >>); parse_host(<< C, Rest/bits >>, E, Acc) -> - case C of - ?INLINE_LOWERCASE(parse_host, Rest, E, Acc) - end. + ?LOWER(parse_host, Rest, E, Acc). %% End of request parsing. %% |