[vlc-commits] http: test case for HTTP/2 payload send

Rémi Denis-Courmont git at videolan.org
Sun Oct 4 12:26:23 CEST 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Oct  4 11:48:05 2020 +0300| [ef2b6b447e9d0d7c44de9b58669179dcee11e4c9] | committer: Rémi Denis-Courmont

http: test case for HTTP/2 payload send

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

 modules/access/http/h2conn_test.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/modules/access/http/h2conn_test.c b/modules/access/http/h2conn_test.c
index 749a3c3bcb..74d5cc15ac 100644
--- a/modules/access/http/h2conn_test.c
+++ b/modules/access/http/h2conn_test.c
@@ -256,6 +256,28 @@ int main(void)
     conn_expect(RST_STREAM);
     conn_expect(RST_STREAM);
 
+    /* Test stream with request payload */
+    sid += 2;
+    s = stream_open(true);
+    assert(s != NULL);
+    stream_continuation(sid);
+    m = vlc_http_msg_get_initial(s);
+    assert(m != NULL);
+    b = block_Alloc(12);
+    assert(b != NULL);
+    memcpy(b->p_buffer, "Hello world!", 12);
+    assert(vlc_http_msg_write(m, b, false) == 0);
+    assert(vlc_http_msg_write(m, NULL, true) == 0);
+    stream_reply(sid, false);
+    m = vlc_http_msg_iterate(m);
+    assert(m != NULL);
+    vlc_http_msg_destroy(m);
+
+    conn_expect(HEADERS);
+    conn_expect(DATA);
+    conn_expect(DATA);
+    conn_expect(RST_STREAM);
+
     /* Test nonexistent stream reset */
     conn_send(vlc_h2_frame_rst_stream(sid + 100, VLC_H2_REFUSED_STREAM));
 



More information about the vlc-commits mailing list