diff options
author | Loïc Hoguin <[email protected]> | 2015-04-13 11:35:23 +0300 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2015-04-13 11:35:23 +0300 |
commit | 35327083c06831d05d5539795e5bed0671e796fb (patch) | |
tree | 4aa8e82b20c04fb3b3ec931c8f4b49ac5b0030d8 /test | |
parent | 27e47ebb7528eb7cc1c92d36a0c3a68bc370eff2 (diff) | |
download | gun-35327083c06831d05d5539795e5bed0671e796fb.tar.gz gun-35327083c06831d05d5539795e5bed0671e796fb.tar.bz2 gun-35327083c06831d05d5539795e5bed0671e796fb.zip |
Add another SPDY test
Diffstat (limited to 'test')
-rw-r--r-- | test/spdy_SUITE.erl | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/spdy_SUITE.erl b/test/spdy_SUITE.erl index a6b1cee..635c601 100644 --- a/test/spdy_SUITE.erl +++ b/test/spdy_SUITE.erl @@ -232,3 +232,19 @@ reject_data_on_half_closed_stream(_) -> ]), wait(), [_, {rst_stream, 1, stream_already_closed}] = spdy_server:stop(ServerPid). + +%% @todo This probably applies to HEADERS frame or SYN_STREAM from server push. +reject_data_on_closed_stream(_) -> + doc("Data frames sent on a closed stream must be rejected " + "with a PROTOCOL_ERROR stream error. (spdy-protocol-draft3-1 2.3.7)"), + {ok, ServerPid, Port} = spdy_server:start_link(), + {ok, ConnPid} = gun:open("localhost", Port, #{transport=>ssl}), + {ok, spdy} = gun:await_up(ConnPid), + %% Send a GET frame so that the stream is closed when the server replies. + _ = gun:get(ConnPid, "/"), + spdy_server:send(ServerPid, [ + {syn_reply, 1, true, <<"200">>, <<"HTTP/1.1">>, []}, + {data, 1, true, <<"Hello world!">>} + ]), + wait(), + [_, {rst_stream, 1, protocol_error}] = spdy_server:stop(ServerPid). |