aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-04-12 21:26:39 +0300
committerLoïc Hoguin <[email protected]>2015-04-12 21:27:22 +0300
commitd5038d46a7546ff6f37fddfa097e1b595bc13f82 (patch)
treefdf7c1be2e9e690e9ec6fdbce0e1a285d2ac1321 /test
parent085b240d2203714c35c999fe2609b47041dbb1fb (diff)
downloadgun-d5038d46a7546ff6f37fddfa097e1b595bc13f82.tar.gz
gun-d5038d46a7546ff6f37fddfa097e1b595bc13f82.tar.bz2
gun-d5038d46a7546ff6f37fddfa097e1b595bc13f82.zip
Add a SPDY test and improve a few badstate messages
Diffstat (limited to 'test')
-rw-r--r--test/spdy_SUITE.erl17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/spdy_SUITE.erl b/test/spdy_SUITE.erl
index 645d13c..c1ae1ba 100644
--- a/test/spdy_SUITE.erl
+++ b/test/spdy_SUITE.erl
@@ -186,3 +186,20 @@ stream_duplicate_streamid(_) ->
]),
wait(),
[_, {goaway, 1, protocol_error}] = spdy_server:stop(ServerPid).
+
+no_sending_frames_after_flag_fin(_) ->
+ doc("Do not send frames after sending FLAG_FIN. (spdy-protocol-draft3-1 2.3.6)"),
+ {ok, ServerPid, Port} = spdy_server:start_link(),
+ {ok, ConnPid} = gun:open("localhost", Port, #{transport=>ssl}),
+ {ok, spdy} = gun:await_up(ConnPid),
+ %% Send a POST frame with no content header so that Gun sets FLAG_FIN,
+ %% then try sending data. Gun should reject this second call.
+ StreamRef = gun:post(ConnPid, "/", []),
+ gun:data(ConnPid, StreamRef, false, <<"Hello world!">>),
+ receive {gun_error, ConnPid, StreamRef, _} ->
+ ok
+ after 5000 ->
+ exit(timeout)
+ end,
+ wait(),
+ [{syn_stream, _, _, _, _, _, _, _, _, _, _, _}] = spdy_server:stop(ServerPid).