diff options
author | Loïc Hoguin <[email protected]> | 2017-02-25 19:57:08 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2017-02-25 19:57:08 +0100 |
commit | 5fd9d5e850354a73f7699fc594b0528dc744404b (patch) | |
tree | 682def6a35dbadd3df62385a21a6ab5b5d7979f8 | |
parent | 4c9fe1f532ac7943361cac81c2edd4484790ae68 (diff) | |
download | cowlib-5fd9d5e850354a73f7699fc594b0528dc744404b.tar.gz cowlib-5fd9d5e850354a73f7699fc594b0528dc744404b.tar.bz2 cowlib-5fd9d5e850354a73f7699fc594b0528dc744404b.zip |
Add cow_http:goaway/2
-rw-r--r-- | src/cow_http2.erl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cow_http2.erl b/src/cow_http2.erl index 555dfc2..4b4600f 100644 --- a/src/cow_http2.erl +++ b/src/cow_http2.erl @@ -29,6 +29,7 @@ -export([push_promise/3]). -export([ping/1]). -export([ping_ack/1]). +-export([goaway/3]). -type streamid() :: pos_integer(). -type fin() :: fin | nofin. @@ -356,6 +357,11 @@ ping(Opaque) -> ping_ack(Opaque) -> << 8:24, 6:8, 0:7, 1:1, 0:32, Opaque:64 >>. +goaway(LastStreamID, Reason, DebugData) -> + ErrorCode = error_code(Reason), + Len = iolist_size(DebugData) + 8, + [<< Len:24, 7:8, 0:41, LastStreamID:31, ErrorCode:32 >>, DebugData]. + flag_fin(nofin) -> 0; flag_fin(fin) -> 1. |