[vlc-commits] https: test refused stream in frame parser

Rémi Denis-Courmont git at videolan.org
Mon Dec 14 22:35:09 CET 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Dec 14 23:33:01 2015 +0200| [ee50c9875487c041480c01368f29536706dab62c] | committer: Rémi Denis-Courmont

https: test refused stream in frame parser

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ee50c9875487c041480c01368f29536706dab62c
---

 modules/access/http/h2frame_test.c |   22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/modules/access/http/h2frame_test.c b/modules/access/http/h2frame_test.c
index 16628c2..7f87456 100644
--- a/modules/access/http/h2frame_test.c
+++ b/modules/access/http/h2frame_test.c
@@ -186,8 +186,9 @@ static void vlc_h2_stream_end(void *ctx)
 static int vlc_h2_stream_error(void *ctx, uint_fast32_t id, uint_fast32_t code)
 {
     assert(ctx == CTX);
-    assert(id == STREAM_ID);
-    assert(code == VLC_H2_PROTOCOL_ERROR);
+
+    assert(id == STREAM_ID + 2);
+    assert(code == VLC_H2_REFUSED_STREAM);
     return 0;
 }
 
@@ -313,9 +314,8 @@ int main(void)
     ret = test_seq(CTX, NULL);
     assert(ret == 0);
 
-    ret = test_seq(CTX, ping(), vlc_h2_frame_pong(42), ping(),
-                   vlc_h2_frame_window_update(0, 0x1000), NULL);
-    assert(ret == 4);
+    ret = test_seq(CTX, ping(), vlc_h2_frame_pong(42), ping(), NULL);
+    assert(ret == 3);
     assert(pings == 2);
     assert(stream_header_tables == 0);
     assert(stream_blocks == 0);
@@ -330,15 +330,21 @@ int main(void)
 
     ret = test_seq(CTX, response(false), data(true), ping(),
                         response(false), data(false), data(true),
-                        response(false), data(false), NULL);
+                        response(false), data(false),
+                        NULL);
     assert(ret == 8);
     assert(pings == 1);
     assert(stream_header_tables == 3);
     assert(stream_blocks == 4);
     assert(stream_ends == 2);
 
-    ret = test_seq(CTX, rst_stream(), NULL);
-    assert(ret == 1);
+    ret = test_seq(CTX, rst_stream(),
+                        vlc_h2_frame_window_update(0, 0x1000),
+                        vlc_h2_frame_headers(STREAM_ID + 2,
+                                             VLC_H2_DEFAULT_MAX_FRAME, true,
+                                             resp_hdrc, resp_hdrv),
+                        NULL);
+    assert(ret == 3);
     assert(pings == 0);
     assert(stream_header_tables == 0);
     assert(stream_blocks == 0);



More information about the vlc-commits mailing list