Lines Matching refs:h2c
323 h2_send_rst_stream_state (request_st * const r, h2con * const h2c) in h2_send_rst_stream_state() argument
328 h2c->half_closed_ts = log_monotonic_secs; in h2_send_rst_stream_state()
348 h2con * const h2c = con->h2; in h2_send_goaway_rst_stream() local
349 const int sent_goaway = h2c->sent_goaway; in h2_send_goaway_rst_stream()
350 for (uint32_t i = 0, rused = h2c->rused; i < rused; ++i) { in h2_send_goaway_rst_stream()
351 request_st * const r = h2c->r[i]; in h2_send_goaway_rst_stream()
353 h2_send_rst_stream_state(r, h2c);/*(sets r->h2state = H2_STATE_CLOSED)*/ in h2_send_goaway_rst_stream()
375 h2con * const h2c = con->h2; in h2_send_goaway() local
376 if (h2c->sent_goaway && (h2c->sent_goaway > 0 || e == H2_E_NO_ERROR)) in h2_send_goaway()
378 h2c->sent_goaway = (e == H2_E_NO_ERROR) ? -1 : (int32_t)e; in h2_send_goaway()
397 goaway.u[3] = htonl(h2c->h2_cid); /* last-stream-id */ in h2_send_goaway()
416 h2con * const h2c = con->h2; in h2_send_refused_stream() local
418 if (h2c->sent_settings) { /*(see h2_recv_settings() comments)*/ in h2_send_refused_stream()
430 for (uint32_t i = 0, rused = h2c->rused; i < rused; ++i) { in h2_send_refused_stream()
431 const request_st * const r = h2c->r[i]; in h2_send_refused_stream()
449 h2c->half_closed_ts = h2c->sent_settings; in h2_send_refused_stream()
453 h2c->h2_cid = h2id; in h2_send_refused_stream()
489 h2con * const h2c = con->h2; in h2_recv_goaway() local
490 if (0 == h2c->rused) return 0; in h2_recv_goaway()
509 h2con * const h2c = con->h2; in h2_recv_rst_stream() local
510 for (uint32_t i = 0, rused = h2c->rused; i < rused; ++i) { in h2_recv_rst_stream()
511 request_st * const r = h2c->r[i]; in h2_recv_rst_stream()
529 if (h2c->sent_goaway && h2c->h2_cid < id) return; in h2_recv_rst_stream()
532 if (h2c->h2_cid < id) { in h2_recv_rst_stream()
580 h2_apply_priority_update (h2con * const h2c, const request_st * const r, const uint32_t rpos) in h2_apply_priority_update() argument
582 const request_st ** const rr = (const request_st **)h2c->r; in h2_apply_priority_update()
593 while (npos+1 < h2c->rused in h2_apply_priority_update()
671 h2con * const h2c = con->h2; in h2_recv_priority_update() local
672 for (uint32_t i = 0, rused = h2c->rused; i < rused; ++i) { in h2_recv_priority_update()
673 request_st * const r = h2c->r[i]; in h2_recv_priority_update()
678 h2_apply_priority_update(h2c, r, i); in h2_recv_priority_update()
684 if (h2c->sent_goaway) in h2_recv_priority_update()
686 if (h2c->h2_cid < prid) { in h2_recv_priority_update()
726 h2con * const h2c = con->h2; in h2_recv_priority() local
727 for (uint32_t i = 0, rused = h2c->rused; i < rused; ++i) { in h2_recv_priority()
728 request_st * const r = h2c->r[i]; in h2_recv_priority()
738 h2_apply_priority_update(h2c, r, i); in h2_recv_priority()
767 h2con * const h2c = con->h2; in h2_recv_window_update() local
768 for (uint32_t i = 0, rused = h2c->rused; i < rused; ++i) { in h2_recv_window_update()
769 request_st * const rr = h2c->r[i]; in h2_recv_window_update()
780 if (h2c->h2_cid < id && 0 == h2c->sent_goaway) in h2_recv_window_update()
852 h2con * const h2c = con->h2; in h2_parse_frame_settings() local
864 if (v == h2c->s_header_table_size) break; in h2_parse_frame_settings()
865 h2c->s_header_table_size = v; in h2_parse_frame_settings()
866 lshpack_enc_set_max_capacity(&h2c->encoder, v); in h2_parse_frame_settings()
873 h2c->s_enable_push = v; in h2_parse_frame_settings()
876 h2c->s_max_concurrent_streams = v; in h2_parse_frame_settings()
883 else if (h2c->rused) { /*(update existing streams)*/ in h2_parse_frame_settings()
887 (int32_t)((uint32_t)v - (uint32_t)h2c->s_initial_window_size); in h2_parse_frame_settings()
888 for (uint32_t i = 0, rused = h2c->rused; i < rused; ++i) { in h2_parse_frame_settings()
889 request_st * const r = h2c->r[i]; in h2_parse_frame_settings()
902 h2c->s_initial_window_size = (int32_t)v; in h2_parse_frame_settings()
909 h2c->s_max_frame_size = v; in h2_parse_frame_settings()
912 h2c->s_max_header_list_size = v; in h2_parse_frame_settings()
940 h2con * const h2c = con->h2; in h2_recv_settings() local
943 if (h2c->sent_goaway <= 0) in h2_recv_settings()
953 else if (h2c->sent_settings) in h2_recv_settings()
954 h2c->sent_settings = 0; in h2_recv_settings()
990 h2con * const h2c = con->h2; in h2_recv_data() local
992 if (0 == id || h2c->h2_cid < id) { /*(RST_STREAM id must not be 0)*/ in h2_recv_data()
1023 for (uint32_t i = 0, rused = h2c->rused; i < rused; ++i) { in h2_recv_data()
1024 request_st * const rr = h2c->r[i]; in h2_recv_data()
1043 if (h2c->half_closed_ts + 2 >= log_monotonic_secs) { in h2_recv_data()
1048 if (!h2c->sent_goaway && 0 != alen) in h2_recv_data()
1213 h2con * const h2c = con->h2; in h2_recv_continuation() local
1214 const uint32_t fsize = h2c->s_max_frame_size; in h2_recv_continuation()
1342 h2_recv_trailers_r (connection * const con, h2con * const h2c, const uint32_t id, const uint32_t fl… in h2_recv_trailers_r() argument
1353 for (uint32_t i = 0, rused = h2c->rused; i < rused; ++i) { in h2_recv_trailers_r()
1354 request_st * const rr = h2c->r[i]; in h2_recv_trailers_r()
1384 h2con * const h2c = r->con->h2; in h2_parse_headers_frame() local
1385 struct lshpack_dec * const restrict decoder = &h2c->decoder; in h2_parse_headers_frame()
1469 if (!h2c->sent_goaway && !trailers) in h2_parse_headers_frame()
1470 h2c->h2_cid = r->h2id; in h2_parse_headers_frame()
1513 h2con * const h2c = con->h2; in h2_recv_headers() local
1529 if (id > h2c->h2_cid) { in h2_recv_headers()
1530 if (h2c->rused == sizeof(h2c->r)/sizeof(*h2c->r)) in h2_recv_headers()
1561 r = h2_recv_trailers_r(con, h2c, id, s[4]); /* (cold code path) */ in h2_recv_headers()
1563 return (h2c->sent_goaway > 0) ? 0 : 1; in h2_recv_headers()
1627 if (!h2c->sent_goaway) { in h2_recv_headers()
1628 h2c->h2_cid = id; in h2_recv_headers()
1670 if (h2c->rused-1) /*(true if more than one active stream)*/ in h2_recv_headers()
1671 h2_apply_priority_update(h2c, r, h2c->rused-1); in h2_recv_headers()
1693 else if (h2c->h2_cid < id) { in h2_recv_headers()
1710 h2con * const h2c = con->h2; in h2_parse_frames() local
1717 const uint32_t fsize = h2c->s_max_frame_size; in h2_parse_frames()
1845 if (h2c->sent_goaway > 0) return 0; in h2_parse_frames()
1949 h2con * const h2c = con->h2 = ck_calloc(1, sizeof(h2con)); in h2_init_con() local
1957 h2c->s_header_table_size = 4096; /* SETTINGS_HEADER_TABLE_SIZE */ in h2_init_con()
1958 h2c->s_enable_push = 1; /* SETTINGS_ENABLE_PUSH */ in h2_init_con()
1959 h2c->s_max_concurrent_streams= ~0u; /* SETTINGS_MAX_CONCURRENT_STREAMS */ in h2_init_con()
1960 h2c->s_initial_window_size = 65536; /* SETTINGS_INITIAL_WINDOW_SIZE */ in h2_init_con()
1961 h2c->s_max_frame_size = 16384; /* SETTINGS_MAX_FRAME_SIZE */ in h2_init_con()
1962 h2c->s_max_header_list_size = ~0u; /* SETTINGS_MAX_HEADER_LIST_SIZE */ in h2_init_con()
1963 h2c->sent_settings = log_monotonic_secs;/*(send SETTINGS below)*/ in h2_init_con()
1965 lshpack_dec_init(&h2c->decoder); in h2_init_con()
1966 lshpack_enc_init(&h2c->encoder); in h2_init_con()
1967 lshpack_enc_use_hist(&h2c->encoder, 1); in h2_init_con()
2071 h2con * const h2c = con->h2; in h2_send_hpack() local
2072 const uint32_t fsize = h2c->s_max_frame_size; in h2_send_hpack()
2142 h2con * const h2c = con->h2; in h2_send_headers() local
2143 struct lshpack_enc * const encoder = &h2c->encoder; in h2_send_headers()
2368 h2con * const h2c = con->h2; in h2_send_headers_block() local
2369 struct lshpack_enc * const encoder = &h2c->encoder; in h2_send_headers_block()
2592 h2con * const h2c = con->h2;
2593 const uint32_t fsize = h2c->s_max_frame_size;
2661 h2con * const h2c = con->h2; in h2_send_cqdata() local
2662 const uint32_t fsize = h2c->s_max_frame_size; in h2_send_cqdata()
2742 h2con * const h2c = con->h2; in h2_send_end_stream_data() local
2743 h2c->half_closed_ts = log_monotonic_secs; in h2_send_end_stream_data()
2782 h2con * const h2c = con->h2; in h2_init_stream() local
2784 force_assert(h2c->rused < sizeof(h2c->r)/sizeof(*h2c->r)); in h2_init_stream()
2789 h2c->r[h2c->rused++] = r; in h2_init_stream()
2791 r->h2_swin = h2c->s_initial_window_size; in h2_init_stream()
2848 h2con * const h2c = con->h2; in h2_retire_stream() local
2849 request_st ** const ar = h2c->r; in h2_retire_stream()
2850 uint32_t i = 0, rused = h2c->rused; in h2_retire_stream()
2857 h2c->r[(h2c->rused = rused)] = NULL; in h2_retire_stream()
2867 h2con * const h2c = con->h2; in h2_retire_con() local
2868 if (NULL == h2c) return; in h2_retire_con()
2872 for (uint32_t i = 0, rused = h2c->rused; i < rused; ++i) { in h2_retire_con()
2874 request_st * const r = h2c->r[i]; in h2_retire_con()
2896 for (uint32_t i = 0, rused = h2c->rused; i < rused; ++i) { in h2_retire_con()
2897 request_st * const r = h2c->r[i]; in h2_retire_con()
2906 lshpack_enc_cleanup(&h2c->encoder); in h2_retire_con()
2907 lshpack_dec_cleanup(&h2c->decoder); in h2_retire_con()
2908 free(h2c); in h2_retire_con()