Commit b00564d0 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

https: revector output test

parent 30d18b6a
......@@ -28,11 +28,8 @@ hpackenc_test_CFLAGS = -DENC_TEST
h2frame_test_SOURCES = access/http/h2frame_test.c \
access/http/hpack.c access/http/hpack.h access/http/hpackenc.c \
access/http/h2frame.c access/http/h2frame.h
h2output_test_SOURCES = access/http/h2output_test.c \
access/http/hpack.c access/http/hpack.h access/http/hpackenc.c \
access/http/h2frame.c access/http/h2frame.h \
access/http/h2output.c access/http/h2output.h
h2output_test_LDADD = $(LIBPTHREAD)
h2output_test_SOURCES = access/http/h2output_test.c
h2output_test_LDADD = libvlc_http.la $(LIBPTHREAD)
h2conn_test_SOURCES = access/http/h2conn_test.c \
access/http/message.c access/http/message.h \
access/http/hpack.c access/http/hpack.h access/http/hpackenc.c \
......
......@@ -41,14 +41,11 @@ static bool send_failure = false;
static bool expect_hello = true;
static vlc_sem_t rx;
static vlc_tls_t fake_tls;
/* Callback for sent frames */
ssize_t vlc_https_send(struct vlc_tls *tls, const void *buf, size_t len)
static ssize_t send_callback(vlc_tls_t *tls, const void *buf, size_t len)
{
const uint8_t *p = buf;
assert(tls == &fake_tls);
assert(tls->send == send_callback);
if (expect_hello)
{
......@@ -73,6 +70,11 @@ ssize_t vlc_https_send(struct vlc_tls *tls, const void *buf, size_t len)
return send_failure ? -1 : (ssize_t)len;
}
static vlc_tls_t fake_tls =
{
.send = send_callback,
};
static struct vlc_h2_frame *frame(unsigned char c)
{
struct vlc_h2_frame *f = vlc_h2_frame_data(1, &c, 1, false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment