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

https: revector HTTP/2 connection test

parent b00564d0
......@@ -30,13 +30,8 @@ h2frame_test_SOURCES = access/http/h2frame_test.c \
access/http/h2frame.c access/http/h2frame.h
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 \
access/http/h2frame.c access/http/h2frame.h \
access/http/h2conn.c access/http/h2conn.h \
access/http/h2output.c access/http/h2output.h
h2conn_test_LDADD = $(LIBPTHREAD)
h2conn_test_SOURCES = access/http/h2conn_test.c
h2conn_test_LDADD = libvlc_http.la $(LIBPTHREAD)
http_msg_test_SOURCES = access/http/message_test.c \
access/http/message.c access/http/message.h
http_file_test_SOURCES = access/http/file_test.c \
......
......@@ -42,31 +42,6 @@
#include "message.h"
#include "transport.h"
/* I/O callbacks */
static int internal_fd = -1;
static vlc_tls_t fake_tls;
ssize_t vlc_https_send(struct vlc_tls *tls, const void *buf, size_t len)
{
assert(tls == &fake_tls);
(void) buf;
return len;
}
ssize_t vlc_https_recv(struct vlc_tls *tls, void *buf, size_t size)
{
assert(tls == &fake_tls);
return read(internal_fd, buf, size);
}
void vlc_https_disconnect(struct vlc_tls *tls)
{
assert(tls == &fake_tls);
if (close(internal_fd))
assert(!"close");
}
static struct vlc_h2_conn *conn;
static int external_fd;
......@@ -87,10 +62,12 @@ static void conn_create(void)
if (socketpair(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC, 0, fds))
assert(!"socketpair");
struct vlc_tls *tls = vlc_tls_DummyCreate(NULL, fds[1]);
assert(tls != NULL);
external_fd = fds[0];
internal_fd = fds[1];
conn = vlc_h2_conn_create(&fake_tls);
conn = vlc_h2_conn_create(tls);
assert(conn != NULL);
conn_send(vlc_h2_frame_settings());
}
......@@ -137,6 +114,8 @@ static void stream_data(uint_fast32_t id, const char *str, bool eos)
conn_send(vlc_h2_frame_data(id, str, strlen(str), eos));
}
/* TODO: check messages coming from the connection under test */
int main(void)
{
struct vlc_http_stream *s, *s2;
......
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