Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[POC] QUIC on Streams #574

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
df9cef5
it works?
kazuho Mar 17, 2024
c598fde
add test
kazuho Mar 17, 2024
34524ab
missing proto
kazuho Mar 17, 2024
1255c32
let `quicly_get_first_timeout` be usable with QoS
kazuho Mar 18, 2024
30429d0
QUICv1 payload cannot be empty but `quicly_qos_receive` should accept…
kazuho Mar 18, 2024
ffdc224
otherwise QoS connections cannot be freed
kazuho Mar 18, 2024
35a4dce
QoS uses idle timeout
kazuho Mar 18, 2024
a3bc946
[QoS] data can be sent without application space
kazuho Mar 18, 2024
0920322
remove unused property
kazuho Mar 18, 2024
939684e
respect idle timeout in QoS
kazuho Mar 18, 2024
04c8415
If the STREAM frame is emitted as the 2nd frame of the buffer provide…
kazuho Jul 22, 2024
c9e968b
Merge branch 'master' into kazuho/quic-on-streams
kazuho Aug 3, 2024
46b62ad
revert 04c8415 to add failing test
kazuho Aug 4, 2024
1f531c3
[QoS] when decoding STREAM frames, respect max_frame_size currently h…
kazuho Aug 4, 2024
1de8f38
add test
kazuho Aug 4, 2024
02300e9
When sending QUIC frames on QoS, always use STREAM frame with the len…
kazuho Aug 5, 2024
557aad4
to suppress signed comparison warning, follow the convention of casti…
kazuho Aug 12, 2024
02c3e4e
Merge branch 'master' into kazuho/quic-on-streams
kazuho Jan 14, 2025
e940034
amend merge
kazuho Jan 14, 2025
3ab06ca
send CONNECTION_CLOSE then immediately indicate freeable
kazuho Jan 22, 2025
0a9e6e2
Merge branch 'master' into kazuho/quic-on-streams
kazuho Jan 22, 2025
2d72c84
Merge branch 'master' into kazuho/quic-on-streams
kazuho Jan 28, 2025
ac34018
Merge branch 'master' into kazuho/quic-on-streams
kazuho Jan 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add test
kazuho committed Aug 5, 2024
commit 1de8f38a9f5be843e90c64e224ef4dd2f6846b32
64 changes: 48 additions & 16 deletions t/test.c
Original file line number Diff line number Diff line change
@@ -742,37 +742,69 @@ static void test_jumpstart_cwnd(void)

static void test_on_streams(void)
{
quicly_conn_t *client_conn = quicly_qos_new(&quic_ctx, 1, NULL), *server_conn = quicly_qos_new(&quic_ctx, 0, NULL);
quicly_stream_t *client_stream = NULL, *server_stream;
quicly_streambuf_t *server_streambuf;
char buf[10480];
size_t bufsize;
static char message16k[16384];

if (message16k[0] == '\0') {
for (size_t i = 0; i < sizeof(message16k); i += 16)
memcpy(message16k + i, "helloworldhello\n", 16);
}

quicly_conn_t *cc = quicly_qos_new(&quic_ctx, 1, NULL), *sc = quicly_qos_new(&quic_ctx, 0, NULL);
quicly_stream_t *cs1 = NULL, *cs2 = NULL, *ss1, *ss2;
quicly_streambuf_t *ss1buf, *ss2buf;
char buf[16384];
size_t bufsize, decoded_len;
int ret;

bufsize = sizeof(buf);
ret = quicly_qos_send(server_conn, buf, &bufsize);
ret = quicly_qos_send(sc, buf, &bufsize);
ok(ret == 0);

ret = quicly_qos_receive(client_conn, buf, &bufsize);
ret = quicly_qos_receive(cc, buf, &bufsize);
ok(ret == 0);

ret = quicly_open_stream(cc, &cs1, 0);
ok(ret == 0);
ret = quicly_streambuf_egress_write(cs1, "hello", 5);
ok(ret == 0);
ret = quicly_open_stream(cc, &cs2, 0);
ok(ret == 0);
ret = quicly_streambuf_egress_write(cs2, message16k, sizeof(message16k));
ok(ret == 0);

ret = quicly_open_stream(client_conn, &client_stream, 0);
bufsize = sizeof(buf);
ret = quicly_qos_send(cc, buf, &bufsize);
ok(ret == 0);
ret = quicly_streambuf_egress_write(client_stream, "hello", 5);

decoded_len = bufsize; /* TODO add test for partial frame receive */
ret = quicly_qos_receive(sc, buf, &decoded_len);
ok(ret == 0);
ok(decoded_len == bufsize);

ss1 = quicly_get_stream(sc, cs1->stream_id);
ok(ss1 != NULL);
ss1buf = ss1->data;
ok(ss1buf->ingress.off == 5);
ok(memcmp(ss1buf->ingress.base, "hello", 5) == 0);

ss2 = quicly_get_stream(sc, cs2->stream_id);
ok(ss2 != NULL);
ss2buf = ss2->data;
ok(ss2buf->ingress.off >= sizeof(message16k) - 400);
ok(ss2buf->ingress.off < sizeof(message16k));
ok(memcmp(ss2buf->ingress.base, message16k, ss2buf->ingress.off) == 0);

bufsize = sizeof(buf);
ret = quicly_qos_send(client_conn, buf, &bufsize);
ret = quicly_qos_send(cc, buf, &bufsize);
ok(ret == 0);

ret = quicly_qos_receive(server_conn, buf, &bufsize);
decoded_len = bufsize;
ret = quicly_qos_receive(sc, buf, &decoded_len);
ok(ret == 0);
ok(decoded_len == bufsize);

server_stream = quicly_get_stream(server_conn, client_stream->stream_id);
ok(server_stream != NULL);
server_streambuf = server_stream->data;
ok(server_streambuf->ingress.off == 5);
ok(memcmp(server_streambuf->ingress.base, "hello", 5) == 0);
ok(ss2buf->ingress.off == sizeof(message16k));
ok(memcmp(ss2buf->ingress.base, message16k, ss2buf->ingress.off) == 0);
}

int main(int argc, char **argv)