Lines Matching refs:conn_io
49 struct conn_io { struct
65 static void flush_egress(struct ev_loop *loop, struct conn_io *conn_io) { in flush_egress() argument
69 ssize_t written = quiche_conn_send(conn_io->conn, out, sizeof(out)); in flush_egress()
81 ssize_t sent = send(conn_io->sock, out, written, 0); in flush_egress()
90 double t = quiche_conn_timeout_as_nanos(conn_io->conn) / 1e9f; in flush_egress()
91 conn_io->timer.repeat = t; in flush_egress()
92 ev_timer_again(loop, &conn_io->timer); in flush_egress()
107 struct conn_io *conn_io = w->data; in recv_cb() local
112 ssize_t read = recv(conn_io->sock, buf, sizeof(buf), 0); in recv_cb()
124 ssize_t done = quiche_conn_recv(conn_io->conn, buf, read); in recv_cb()
136 if (quiche_conn_is_closed(conn_io->conn)) { in recv_cb()
143 if (quiche_conn_is_established(conn_io->conn) && !req_sent) { in recv_cb()
147 quiche_conn_application_proto(conn_io->conn, &app_proto, &app_proto_len); in recv_cb()
158 conn_io->http3 = quiche_h3_conn_new_with_transport(conn_io->conn, config); in recv_cb()
159 if (conn_io->http3 == NULL) { in recv_cb()
187 .value = (const uint8_t *) conn_io->host, in recv_cb()
188 .value_len = strlen(conn_io->host), in recv_cb()
208 int64_t stream_id = quiche_h3_send_request(conn_io->http3, in recv_cb()
209 conn_io->conn, in recv_cb()
217 if (quiche_conn_is_established(conn_io->conn)) { in recv_cb()
221 int64_t s = quiche_h3_conn_poll(conn_io->http3, in recv_cb()
222 conn_io->conn, in recv_cb()
242 ssize_t len = quiche_h3_recv_body(conn_io->http3, in recv_cb()
243 conn_io->conn, s, in recv_cb()
254 if (quiche_conn_close(conn_io->conn, true, 0, NULL, 0) < 0) { in recv_cb()
272 flush_egress(loop, conn_io); in recv_cb()
276 struct conn_io *conn_io = w->data; in timeout_cb() local
277 quiche_conn_on_timeout(conn_io->conn); in timeout_cb()
281 flush_egress(loop, conn_io); in timeout_cb()
283 if (quiche_conn_is_closed(conn_io->conn)) { in timeout_cb()
286 quiche_conn_stats(conn_io->conn, &stats); in timeout_cb()
376 struct conn_io *conn_io = malloc(sizeof(*conn_io)); in main() local
377 if (conn_io == NULL) { in main()
382 conn_io->sock = sock; in main()
383 conn_io->conn = conn; in main()
384 conn_io->host = host; in main()
390 ev_io_init(&watcher, recv_cb, conn_io->sock, EV_READ); in main()
392 watcher.data = conn_io; in main()
394 ev_init(&conn_io->timer, timeout_cb); in main()
395 conn_io->timer.data = conn_io; in main()
397 flush_egress(loop, conn_io); in main()
403 quiche_h3_conn_free(conn_io->http3); in main()