aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cow_http_te.erl6
-rw-r--r--src/cow_ws.erl6
2 files changed, 8 insertions, 4 deletions
diff --git a/src/cow_http_te.erl b/src/cow_http_te.erl
index d3cb4a0..59f4b86 100644
--- a/src/cow_http_te.erl
+++ b/src/cow_http_te.erl
@@ -128,10 +128,10 @@ horse_stream_identity_dripfeed() ->
%% @doc Decode a chunked stream.
-spec stream_chunked(Data, State)
- -> more | {more, Data, State} | {more, Data, Len, State}
+ -> more | {more, Data, State} | {more, Data, non_neg_integer(), State}
| {more, Data, Data, State}
- | {done, Len, Data} | {done, Data, Len, Data}
- when Data::binary(), State::state(), Len::non_neg_integer().
+ | {done, HasTrailers, Data} | {done, Data, HasTrailers, Data}
+ when Data::binary(), State::state(), HasTrailers::trailers | no_trailers.
stream_chunked(Data, State) ->
stream_chunked(Data, State, <<>>).
diff --git a/src/cow_ws.erl b/src/cow_ws.erl
index 3d3807f..bac8450 100644
--- a/src/cow_ws.erl
+++ b/src/cow_ws.erl
@@ -349,7 +349,11 @@ frag_state(_, 1, _, FragState) -> FragState.
-spec parse_payload(binary(), mask_key(), utf8_state(), non_neg_integer(),
frame_type(), non_neg_integer(), frag_state(), extensions(), rsv())
- -> {ok, binary(), utf8_state(), binary()} | {more, binary(), utf8_state()} | error.
+ -> {ok, binary(), utf8_state(), binary()}
+ | {ok, close_code(), binary(), utf8_state(), binary()}
+ | {more, binary(), utf8_state()}
+ | {more, close_code(), binary(), utf8_state()}
+ | {error, badframe | badencoding}.
%% Empty last frame of compressed message.
parse_payload(Data, _, Utf8State, _, _, 0, {fin, _, << 1:1, 0:2 >>},
#{inflate := Inflate, inflate_takeover := TakeOver}, _) ->