Skip to content

Instantly share code, notes, and snippets.

View gist:fa5a95e0aa2c44b552a78ba5ea0b5cdc
commit 2340bc1ef749df3494ed8897e438fd747e978b67 (origin/kazuho/travis-test, kazuho/travis-test)
Author: Kazuho Oku <kazuhooku@gmail.com>
Date: Mon Mar 22 20:41:34 2021 +0900
add assertion
diff --git a/lib/common/http1client.c b/lib/common/http1client.c
index 25c580d97..221c4b38b 100644
--- a/lib/common/http1client.c
+++ b/lib/common/http1client.c
View iw10.log
{"type":"packet-sent", "conn":0, "time":1611735067804, "pn":0, "len":1280, "packet-type":0, "ack-only":0}
{"type":"packet-received", "conn":0, "time":1611735067806, "pn":0, "decrypted":"0x7ffeebbe60c5", "decrypted-len":99, "packet-type":0}
{"type":"packet-acked", "conn":0, "time":1611735067806, "pn":0, "is-late-ack":0}
{"type":"packet-received", "conn":0, "time":1611735067806, "pn":1, "decrypted":"0x7ffeebbe615c", "decrypted-len":1076, "packet-type":2}
{"type":"packet-received", "conn":0, "time":1611735067806, "pn":2, "decrypted":"0x7ffeebbe65c4", "decrypted-len":1228, "packet-type":2}
{"type":"packet-received", "conn":0, "time":1611735067806, "pn":3, "decrypted":"0x7ffeebbe6ac4", "decrypted-len":715, "packet-type":2}
{"type":"packet-received", "conn":0, "time":1611735067806, "pn":4, "decrypted":"0x7ffeebbe6daa", "decrypted-len":363, "packet-type":3}
{"type":"packet-sent", "conn":0, "time":1611735067806, "pn":1, "len":112, "packet-type":2, "ack-only":0}
{"type":"packet-sent", "conn":0, "time":1611735067806, "
View master.log
$ build/default/cli -e /dev/stdout -k tmp/server.key -c tmp/server.crt 127.0.0.1 4433 2>&1 | egrep 'packet-(sent|ack)'
{"type":"packet-sent", "conn":0, "time":1611723421519, "pn":0, "len":168, "packet-type":0, "ack-only":0}
{"type":"packet-sent", "conn":0, "time":1611723421519, "pn":1, "len":1182, "packet-type":2, "ack-only":0}
{"type":"packet-sent", "conn":0, "time":1611723421519, "pn":2, "len":161, "packet-type":2, "ack-only":0}
{"type":"packet-sent", "conn":0, "time":1611723421519, "pn":3, "len":211, "packet-type":3, "ack-only":0}
{"type":"packet-acked", "conn":0, "time":1611723421521, "pn":1, "is-late-ack":0}
{"type":"packet-acked", "conn":0, "time":1611723421522, "pn":2, "is-late-ack":0}
{"type":"packet-acked", "conn":0, "time":1611723421522, "pn":3, "is-late-ack":0}
{"type":"packet-sent", "conn":0, "time":1611723421522, "pn":4, "len":1350, "packet-type":3, "ack-only":0}
{"type":"packet-sent", "conn":0, "time":1611723421522, "pn":5, "len":1350, "packet-type":3, "ack-only":0}
View gist:8bcb6677efd31bba61a20d6b78eadbe6
2020-12-20T14:35:38.4920976Z t/40tls13-early-data.t ...............................
2020-12-20T14:35:38.4929315Z # Subtest: http/1
2020-12-20T14:35:38.5995191Z spawning /home/ci/build/h2o... done
2020-12-20T14:35:38.6020404Z # Subtest: proxy
2020-12-20T14:35:38.6021071Z # Subtest: sleep=0
2020-12-20T14:35:38.6375745Z Plack::Handler::Starlet: Accepting connections at http://127.0.0.1:34579/
2020-12-20T14:35:38.7166997Z H2O_DEBUG send_client_hello:2115
2020-12-20T14:35:38.9736437Z [INFO] raised RLIMIT_NOFILE to 1048576
2020-12-20T14:35:38.9851890Z h2o server (pid:16277) is ready to serve requests with 1 threads
2020-12-20T14:35:38.9876672Z H2O_DEBUG send_session_ticket:1417
View gist:b4467a04a73ef2013868e15593d8a646
diff --git a/deps/picotls/lib/picotls.c b/deps/picotls/lib/picotls.c
index 9f841207e..3512ac246 100644
--- a/deps/picotls/lib/picotls.c
+++ b/deps/picotls/lib/picotls.c
@@ -1414,6 +1414,8 @@ static int send_session_ticket(ptls_t *tls, ptls_message_emitter_t *emitter)
assert(tls->ctx->ticket_lifetime != 0);
assert(tls->ctx->encrypt_ticket != NULL);
+if (getenv("H2O_DEBUG") != NULL) fprintf(stderr, "H2O_DEBUG %s:%d\n", __FUNCTION__, __LINE__);
+
View gist:f0d15ba76bf38cce99c22d97269c285e
127.0.0.1 - - [24/Aug/2020:09:33:19 +0900] "GET /100x10k/ HTTP/3" 200 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4242.0 Safari/537.36" "-, stream-id=0, packets-received=10,packets-decryption-failed=0,packets-sent=10,packets-lost=0,packets-ack-received=8,bytes-received=3549,bytes-sent=6356,rtt-minimum=22,rtt-smoothed=22,rtt-variance=6,rtt-latest=25,cwnd=18215"
127.0.0.1 - - [24/Aug/2020:09:33:19 +0900] "GET /100x10k/10k.jpg?1 HTTP/3" 200 0 "https://127.0.0.1.examp1e.net:8444/100x10k/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4242.0 Safari/537.36" "-, stream-id=4, packets-received=20,packets-decryption-failed=0,packets-sent=41,packets-lost=0,packets-ack-received=17,bytes-received=5784,bytes-sent=43911,rtt-minimum=22,rtt-smoothed=22,rtt-variance=1,rtt-latest=22,cwnd=28975"
127.0.0.1 - - [24/Aug/2020:09:33:19 +0900] "GET /100x10k/10k.jpg?2 HTTP/3" 200 0 "https://127.0.0.1.examp1e.net:8444/100x
View gist:3cb91075625db57c3f18f7850f09d6bb
# /etc/exports (macOS)
/mydev -mapall=user:group -network 127.0.0.1 -mask 255.255.255.0
# /etc/nfsd.conf (macOS)
nfs.server.udp=0
nfs.server.tcp=1
nfs.server.mount.port=635
nfs.server.mount.require_resv_port=0
nfs.server.require_resv_port=0
View gist:68611a6fdc80a86414d95b84cd55994f
{"type":"accept", "conn":0, "time":1593928818423, "dcid":"274076836d80b1a8", "address-token":"0x0"}
{"type":"crypto-decrypt", "conn":0, "time":1593928818423, "pn":1, "decrypted":"0x7ffee816f7a3", "decrypted-len":1315}
{"type":"quictrace-recv", "conn":0, "time":1593928818423, "pn":1}
{"type":"stream-receive", "conn":0, "time":1593928818423, "stream-id":-1, "off":0, "len":512}
{"type":"crypto-handshake", "conn":0, "time":1593928818423, "ret":0}
{"type":"send", "conn":0, "time":1593928818426, "state":1, "dcid":""}
{"type":"packet-prepare", "conn":0, "time":1593928818426, "first-octet":192, "dcid":""}
{"type":"ack-send", "conn":0, "time":1593928818426, "largest-acked":1, "ack-delay":2}
{"type":"stream-send", "conn":0, "time":1593928818426, "stream-id":-1, "off":0, "len":90, "is-fin":0}
{"type":"quictrace-send-stream", "conn":0, "time":1593928818426, "stream-id":-1, "off":0, "len":90, "fin":0}
View gist:92f38b999f143ba1406ae7d51eca9cea
{"type":"accept", "conn":3, "time":1593905003402, "dcid":"d9d9a7fb9fe2036e", "address-token":"0x0"}
{"type":"crypto-decrypt", "conn":3, "time":1593905003402, "pn":1, "decrypted":"0x7ffee793f7a3", "decrypted-len":1315}
{"type":"quictrace-recv", "conn":3, "time":1593905003402, "pn":1}
{"type":"stream-receive", "conn":3, "time":1593905003402, "stream-id":-1, "off":0, "len":512}
{"type":"crypto-handshake", "conn":3, "time":1593905003402, "ret":0}
{"type":"send", "conn":3, "time":1593905003405, "state":1, "dcid":""}
{"type":"packet-prepare", "conn":3, "time":1593905003405, "first-octet":192, "dcid":""}
{"type":"ack-send", "conn":3, "time":1593905003405, "largest-acked":1, "ack-delay":2}
{"type":"stream-send", "conn":3, "time":1593905003405, "stream-id":-1, "off":0, "len":90, "is-fin":0}
{"type":"quictrace-send-stream", "conn":3, "time":1593905003405, "stream-id":-1, "off":0, "len":90, "fin":0}
@kazuho
kazuho / procstat
Created Jun 19, 2020
script for collecting CPU and network usage
View procstat
#! /usr/bin/perl
use strict;
use warnings;
use Getopt::Long;
use Scope::Guard;
my $nic;
GetOptions("nic=s" => \$nic);