• Home
  • Raw
  • Download

Lines Matching refs:iframe

231   session->iframe.state = NGHTTP2_IB_IGN_ALL;  in session_terminate_session()
306 nghttp2_inbound_frame *iframe = &session->iframe; in session_inbound_frame_reset() local
311 switch (iframe->frame.hd.type) { in session_inbound_frame_reset()
315 nghttp2_frame_headers_free(&iframe->frame.headers, mem); in session_inbound_frame_reset()
318 nghttp2_frame_priority_free(&iframe->frame.priority); in session_inbound_frame_reset()
321 nghttp2_frame_rst_stream_free(&iframe->frame.rst_stream); in session_inbound_frame_reset()
324 nghttp2_frame_settings_free(&iframe->frame.settings, mem); in session_inbound_frame_reset()
326 nghttp2_mem_free(mem, iframe->iv); in session_inbound_frame_reset()
328 iframe->iv = NULL; in session_inbound_frame_reset()
329 iframe->niv = 0; in session_inbound_frame_reset()
330 iframe->max_niv = 0; in session_inbound_frame_reset()
334 nghttp2_frame_push_promise_free(&iframe->frame.push_promise, mem); in session_inbound_frame_reset()
337 nghttp2_frame_ping_free(&iframe->frame.ping); in session_inbound_frame_reset()
340 nghttp2_frame_goaway_free(&iframe->frame.goaway, mem); in session_inbound_frame_reset()
343 nghttp2_frame_window_update_free(&iframe->frame.window_update); in session_inbound_frame_reset()
348 iframe->frame.hd.type)) { in session_inbound_frame_reset()
349 nghttp2_frame_extension_free(&iframe->frame.ext); in session_inbound_frame_reset()
351 switch (iframe->frame.hd.type) { in session_inbound_frame_reset()
356 nghttp2_frame_altsvc_free(&iframe->frame.ext, mem); in session_inbound_frame_reset()
362 nghttp2_frame_origin_free(&iframe->frame.ext, mem); in session_inbound_frame_reset()
378 memset(&iframe->frame, 0, sizeof(nghttp2_frame)); in session_inbound_frame_reset()
379 memset(&iframe->ext_frame_payload, 0, sizeof(nghttp2_ext_frame_payload)); in session_inbound_frame_reset()
381 iframe->state = NGHTTP2_IB_READ_HEAD; in session_inbound_frame_reset()
383 nghttp2_buf_wrap_init(&iframe->sbuf, iframe->raw_sbuf, in session_inbound_frame_reset()
384 sizeof(iframe->raw_sbuf)); in session_inbound_frame_reset()
385 iframe->sbuf.mark += NGHTTP2_FRAME_HDLEN; in session_inbound_frame_reset()
387 nghttp2_buf_free(&iframe->lbuf, mem); in session_inbound_frame_reset()
388 nghttp2_buf_wrap_init(&iframe->lbuf, NULL, 0); in session_inbound_frame_reset()
390 iframe->raw_lbuf = NULL; in session_inbound_frame_reset()
392 iframe->payloadleft = 0; in session_inbound_frame_reset()
393 iframe->padlen = 0; in session_inbound_frame_reset()
625 nghttp2_inbound_frame *iframe = &(*session_ptr)->iframe; in session_new() local
629 iframe->state = NGHTTP2_IB_READ_CLIENT_MAGIC; in session_new()
630 iframe->payloadleft = NGHTTP2_CLIENT_MAGIC_LEN; in session_new()
632 iframe->state = NGHTTP2_IB_READ_FIRST_SETTINGS; in session_new()
3756 nghttp2_inbound_frame *iframe = &session->iframe; in session_call_on_extension_chunk_recv_callback() local
3757 nghttp2_frame *frame = &iframe->frame; in session_call_on_extension_chunk_recv_callback()
3775 nghttp2_inbound_frame *iframe = &session->iframe; in session_call_unpack_extension_callback() local
3776 nghttp2_frame *frame = &iframe->frame; in session_call_unpack_extension_callback()
3975 if (session->iframe.state == NGHTTP2_IB_READ_HEADER_BLOCK) { in inflate_header_block()
4130 nghttp2_frame *frame = &session->iframe.frame; in session_after_header_block_received()
4439 nghttp2_inbound_frame *iframe = &session->iframe; in session_process_headers_frame() local
4440 nghttp2_frame *frame = &iframe->frame; in session_process_headers_frame()
4443 rv = nghttp2_frame_unpack_headers_payload(&frame->headers, iframe->sbuf.pos); in session_process_headers_frame()
4532 nghttp2_inbound_frame *iframe = &session->iframe; in session_process_priority_frame() local
4533 nghttp2_frame *frame = &iframe->frame; in session_process_priority_frame()
4537 nghttp2_frame_unpack_priority_payload(&frame->priority, iframe->sbuf.pos); in session_process_priority_frame()
4593 nghttp2_inbound_frame *iframe = &session->iframe; in session_process_rst_stream_frame() local
4594 nghttp2_frame *frame = &iframe->frame; in session_process_rst_stream_frame()
4596 nghttp2_frame_unpack_rst_stream_payload(&frame->rst_stream, iframe->sbuf.pos); in session_process_rst_stream_frame()
5006 nghttp2_inbound_frame *iframe = &session->iframe; in session_process_settings_frame() local
5007 nghttp2_frame *frame = &iframe->frame; in session_process_settings_frame()
5011 if (iframe->max_niv) { in session_process_settings_frame()
5012 min_header_size_entry = iframe->iv[iframe->max_niv - 1]; in session_process_settings_frame()
5017 for (i = 0; i < iframe->niv; ++i) { in session_process_settings_frame()
5018 if (iframe->iv[i].settings_id == NGHTTP2_SETTINGS_HEADER_TABLE_SIZE) { in session_process_settings_frame()
5023 assert(i < iframe->niv); in session_process_settings_frame()
5025 if (min_header_size_entry.value != iframe->iv[i].value) { in session_process_settings_frame()
5026 iframe->iv[iframe->niv++] = iframe->iv[i]; in session_process_settings_frame()
5027 iframe->iv[i] = min_header_size_entry; in session_process_settings_frame()
5032 nghttp2_frame_unpack_settings_payload(&frame->settings, iframe->iv, in session_process_settings_frame()
5033 iframe->niv); in session_process_settings_frame()
5035 iframe->iv = NULL; in session_process_settings_frame()
5036 iframe->niv = 0; in session_process_settings_frame()
5037 iframe->max_niv = 0; in session_process_settings_frame()
5130 nghttp2_inbound_frame *iframe = &session->iframe; in session_process_push_promise_frame() local
5131 nghttp2_frame *frame = &iframe->frame; in session_process_push_promise_frame()
5134 iframe->sbuf.pos); in session_process_push_promise_frame()
5165 nghttp2_inbound_frame *iframe = &session->iframe; in session_process_ping_frame() local
5166 nghttp2_frame *frame = &iframe->frame; in session_process_ping_frame()
5168 nghttp2_frame_unpack_ping_payload(&frame->ping, iframe->sbuf.pos); in session_process_ping_frame()
5206 nghttp2_inbound_frame *iframe = &session->iframe; in session_process_goaway_frame() local
5207 nghttp2_frame *frame = &iframe->frame; in session_process_goaway_frame()
5209 nghttp2_frame_unpack_goaway_payload(&frame->goaway, iframe->sbuf.pos, in session_process_goaway_frame()
5210 iframe->lbuf.pos, in session_process_goaway_frame()
5211 nghttp2_buf_len(&iframe->lbuf)); in session_process_goaway_frame()
5213 nghttp2_buf_wrap_init(&iframe->lbuf, NULL, 0); in session_process_goaway_frame()
5291 nghttp2_inbound_frame *iframe = &session->iframe; in session_process_window_update_frame() local
5292 nghttp2_frame *frame = &iframe->frame; in session_process_window_update_frame()
5295 iframe->sbuf.pos); in session_process_window_update_frame()
5418 nghttp2_inbound_frame *iframe = &session->iframe; in session_process_altsvc_frame() local
5419 nghttp2_frame *frame = &iframe->frame; in session_process_altsvc_frame()
5422 &frame->ext, nghttp2_get_uint16(iframe->sbuf.pos), iframe->lbuf.pos, in session_process_altsvc_frame()
5423 nghttp2_buf_len(&iframe->lbuf)); in session_process_altsvc_frame()
5427 nghttp2_buf_wrap_init(&iframe->lbuf, NULL, 0); in session_process_altsvc_frame()
5433 nghttp2_inbound_frame *iframe = &session->iframe; in session_process_origin_frame() local
5434 nghttp2_frame *frame = &iframe->frame; in session_process_origin_frame()
5438 rv = nghttp2_frame_unpack_origin_payload(&frame->ext, iframe->lbuf.pos, in session_process_origin_frame()
5439 nghttp2_buf_len(&iframe->lbuf), mem); in session_process_origin_frame()
5452 nghttp2_inbound_frame *iframe = &session->iframe; in session_process_priority_update_frame() local
5453 nghttp2_frame *frame = &iframe->frame; in session_process_priority_update_frame()
5455 nghttp2_frame_unpack_priority_update_payload(&frame->ext, iframe->sbuf.pos, in session_process_priority_update_frame()
5456 nghttp2_buf_len(&iframe->sbuf)); in session_process_priority_update_frame()
5463 nghttp2_inbound_frame *iframe = &session->iframe; in session_process_extension_frame() local
5464 nghttp2_frame *frame = &iframe->frame; in session_process_extension_frame()
5528 nghttp2_frame *public_data_frame = &session->iframe.frame; in session_process_data_frame()
5688 nghttp2_inbound_frame *iframe; in session_on_data_received_fail_fast() local
5693 iframe = &session->iframe; in session_on_data_received_fail_fast()
5694 stream_id = iframe->frame.hd.stream_id; in session_on_data_received_fail_fast()
5754 static size_t inbound_frame_payload_readlen(nghttp2_inbound_frame *iframe, in inbound_frame_payload_readlen() argument
5757 return nghttp2_min((size_t)(last - in), iframe->payloadleft); in inbound_frame_payload_readlen()
5763 static void inbound_frame_set_mark(nghttp2_inbound_frame *iframe, size_t left) { in inbound_frame_set_mark() argument
5764 nghttp2_buf_reset(&iframe->sbuf); in inbound_frame_set_mark()
5765 iframe->sbuf.mark += left; in inbound_frame_set_mark()
5768 static size_t inbound_frame_buf_read(nghttp2_inbound_frame *iframe, in inbound_frame_buf_read() argument
5773 nghttp2_min((size_t)(last - in), nghttp2_buf_mark_avail(&iframe->sbuf)); in inbound_frame_buf_read()
5775 iframe->sbuf.last = nghttp2_cpymem(iframe->sbuf.last, in, readlen); in inbound_frame_buf_read()
5783 static void inbound_frame_set_settings_entry(nghttp2_inbound_frame *iframe) { in inbound_frame_set_settings_entry() argument
5788 nghttp2_frame_unpack_settings_entry(&iv, iframe->sbuf.pos); in inbound_frame_set_settings_entry()
5803 iframe->iv[iframe->niv++] = iv; in inbound_frame_set_settings_entry()
5808 for (i = 0; i < iframe->niv; ++i) { in inbound_frame_set_settings_entry()
5809 if (iframe->iv[i].settings_id == iv.settings_id) { in inbound_frame_set_settings_entry()
5810 iframe->iv[i] = iv; in inbound_frame_set_settings_entry()
5815 if (i == iframe->niv) { in inbound_frame_set_settings_entry()
5816 iframe->iv[iframe->niv++] = iv; in inbound_frame_set_settings_entry()
5821 min_header_table_size_entry = &iframe->iv[iframe->max_niv - 1]; in inbound_frame_set_settings_entry()
5834 static int inbound_frame_handle_pad(nghttp2_inbound_frame *iframe, in inbound_frame_handle_pad() argument
5840 inbound_frame_set_mark(iframe, 1); in inbound_frame_handle_pad()
5851 static ssize_t inbound_frame_compute_pad(nghttp2_inbound_frame *iframe) { in inbound_frame_compute_pad() argument
5855 padlen = (size_t)(iframe->sbuf.pos[0] + 1); in inbound_frame_compute_pad()
5860 if (padlen - 1 > iframe->payloadleft) { in inbound_frame_compute_pad()
5864 iframe->padlen = padlen; in inbound_frame_compute_pad()
5875 static ssize_t inbound_frame_effective_readlen(nghttp2_inbound_frame *iframe, in inbound_frame_effective_readlen() argument
5879 nghttp2_frame_trail_padlen(&iframe->frame, iframe->padlen); in inbound_frame_effective_readlen()
5897 nghttp2_inbound_frame *iframe = &session->iframe; in nghttp2_session_mem_recv() local
5933 switch (iframe->state) { in nghttp2_session_mem_recv()
5935 readlen = nghttp2_min(inlen, iframe->payloadleft); in nghttp2_session_mem_recv()
5938 iframe->payloadleft], in nghttp2_session_mem_recv()
5943 iframe->payloadleft -= readlen; in nghttp2_session_mem_recv()
5946 if (iframe->payloadleft == 0) { in nghttp2_session_mem_recv()
5948 iframe->state = NGHTTP2_IB_READ_FIRST_SETTINGS; in nghttp2_session_mem_recv()
5955 readlen = inbound_frame_buf_read(iframe, in, last); in nghttp2_session_mem_recv()
5958 if (nghttp2_buf_mark_avail(&iframe->sbuf)) { in nghttp2_session_mem_recv()
5962 if (iframe->sbuf.pos[3] != NGHTTP2_SETTINGS || in nghttp2_session_mem_recv()
5963 (iframe->sbuf.pos[4] & NGHTTP2_FLAG_ACK)) { in nghttp2_session_mem_recv()
5984 iframe->state = NGHTTP2_IB_READ_HEAD; in nghttp2_session_mem_recv()
5992 readlen = inbound_frame_buf_read(iframe, in, last); in nghttp2_session_mem_recv()
5995 if (nghttp2_buf_mark_avail(&iframe->sbuf)) { in nghttp2_session_mem_recv()
5999 nghttp2_frame_unpack_frame_hd(&iframe->frame.hd, iframe->sbuf.pos); in nghttp2_session_mem_recv()
6000 iframe->payloadleft = iframe->frame.hd.length; in nghttp2_session_mem_recv()
6003 iframe->frame.hd.length, iframe->frame.hd.type, in nghttp2_session_mem_recv()
6004 iframe->frame.hd.flags, iframe->frame.hd.stream_id); in nghttp2_session_mem_recv()
6006 if (iframe->frame.hd.length > session->local_settings.max_frame_size) { in nghttp2_session_mem_recv()
6007 DEBUGF("recv: length is too large %zu > %u\n", iframe->frame.hd.length, in nghttp2_session_mem_recv()
6020 switch (iframe->frame.hd.type) { in nghttp2_session_mem_recv()
6024 iframe->frame.hd.flags &= in nghttp2_session_mem_recv()
6031 if (iframe->state == NGHTTP2_IB_IGN_ALL) { in nghttp2_session_mem_recv()
6036 iframe->frame.hd.stream_id); in nghttp2_session_mem_recv()
6037 iframe->state = NGHTTP2_IB_IGN_DATA; in nghttp2_session_mem_recv()
6045 rv = inbound_frame_handle_pad(iframe, &iframe->frame.hd); in nghttp2_session_mem_recv()
6058 iframe->state = NGHTTP2_IB_READ_PAD_DATA; in nghttp2_session_mem_recv()
6062 iframe->state = NGHTTP2_IB_READ_DATA; in nghttp2_session_mem_recv()
6069 iframe->frame.hd.flags &= in nghttp2_session_mem_recv()
6073 rv = inbound_frame_handle_pad(iframe, &iframe->frame.hd); in nghttp2_session_mem_recv()
6085 iframe->state = NGHTTP2_IB_READ_NBYTE; in nghttp2_session_mem_recv()
6089 pri_fieldlen = nghttp2_frame_priority_len(iframe->frame.hd.flags); in nghttp2_session_mem_recv()
6092 if (iframe->payloadleft < pri_fieldlen) { in nghttp2_session_mem_recv()
6094 iframe->state = NGHTTP2_IB_FRAME_SIZE_ERROR; in nghttp2_session_mem_recv()
6098 iframe->state = NGHTTP2_IB_READ_NBYTE; in nghttp2_session_mem_recv()
6100 inbound_frame_set_mark(iframe, pri_fieldlen); in nghttp2_session_mem_recv()
6108 rv = session_call_on_begin_frame(session, &iframe->frame.hd); in nghttp2_session_mem_recv()
6123 if (iframe->state == NGHTTP2_IB_IGN_ALL) { in nghttp2_session_mem_recv()
6129 session, iframe->frame.hd.stream_id, NGHTTP2_INTERNAL_ERROR); in nghttp2_session_mem_recv()
6133 iframe->state = NGHTTP2_IB_IGN_HEADER_BLOCK; in nghttp2_session_mem_recv()
6138 iframe->state = NGHTTP2_IB_IGN_HEADER_BLOCK; in nghttp2_session_mem_recv()
6142 iframe->state = NGHTTP2_IB_READ_HEADER_BLOCK; in nghttp2_session_mem_recv()
6148 iframe->frame.hd.flags = NGHTTP2_FLAG_NONE; in nghttp2_session_mem_recv()
6150 if (iframe->payloadleft != NGHTTP2_PRIORITY_SPECLEN) { in nghttp2_session_mem_recv()
6153 iframe->state = NGHTTP2_IB_FRAME_SIZE_ERROR; in nghttp2_session_mem_recv()
6158 iframe->state = NGHTTP2_IB_READ_NBYTE; in nghttp2_session_mem_recv()
6160 inbound_frame_set_mark(iframe, NGHTTP2_PRIORITY_SPECLEN); in nghttp2_session_mem_recv()
6166 switch (iframe->frame.hd.type) { in nghttp2_session_mem_recv()
6176 iframe->frame.hd.flags = NGHTTP2_FLAG_NONE; in nghttp2_session_mem_recv()
6178 if (iframe->payloadleft != 4) { in nghttp2_session_mem_recv()
6180 iframe->state = NGHTTP2_IB_FRAME_SIZE_ERROR; in nghttp2_session_mem_recv()
6184 iframe->state = NGHTTP2_IB_READ_NBYTE; in nghttp2_session_mem_recv()
6186 inbound_frame_set_mark(iframe, 4); in nghttp2_session_mem_recv()
6192 iframe->frame.hd.flags &= NGHTTP2_FLAG_ACK; in nghttp2_session_mem_recv()
6194 if ((iframe->frame.hd.length % NGHTTP2_FRAME_SETTINGS_ENTRY_LENGTH) || in nghttp2_session_mem_recv()
6195 ((iframe->frame.hd.flags & NGHTTP2_FLAG_ACK) && in nghttp2_session_mem_recv()
6196 iframe->payloadleft > 0)) { in nghttp2_session_mem_recv()
6198 iframe->state = NGHTTP2_IB_FRAME_SIZE_ERROR; in nghttp2_session_mem_recv()
6204 !(iframe->frame.hd.flags & NGHTTP2_FLAG_ACK)) { in nghttp2_session_mem_recv()
6208 iframe->state = NGHTTP2_IB_READ_SETTINGS; in nghttp2_session_mem_recv()
6210 if (iframe->payloadleft) { in nghttp2_session_mem_recv()
6215 iframe->max_niv = in nghttp2_session_mem_recv()
6216 iframe->frame.hd.length / NGHTTP2_FRAME_SETTINGS_ENTRY_LENGTH + 1; in nghttp2_session_mem_recv()
6218 if (iframe->max_niv - 1 > session->max_settings) { in nghttp2_session_mem_recv()
6228 iframe->iv = nghttp2_mem_malloc(mem, sizeof(nghttp2_settings_entry) * in nghttp2_session_mem_recv()
6229 iframe->max_niv); in nghttp2_session_mem_recv()
6231 if (!iframe->iv) { in nghttp2_session_mem_recv()
6235 min_header_table_size_entry = &iframe->iv[iframe->max_niv - 1]; in nghttp2_session_mem_recv()
6240 inbound_frame_set_mark(iframe, NGHTTP2_FRAME_SETTINGS_ENTRY_LENGTH); in nghttp2_session_mem_recv()
6246 inbound_frame_set_mark(iframe, 0); in nghttp2_session_mem_recv()
6252 iframe->frame.hd.flags &= in nghttp2_session_mem_recv()
6255 rv = inbound_frame_handle_pad(iframe, &iframe->frame.hd); in nghttp2_session_mem_recv()
6267 iframe->state = NGHTTP2_IB_READ_NBYTE; in nghttp2_session_mem_recv()
6271 if (iframe->payloadleft < 4) { in nghttp2_session_mem_recv()
6273 iframe->state = NGHTTP2_IB_FRAME_SIZE_ERROR; in nghttp2_session_mem_recv()
6277 iframe->state = NGHTTP2_IB_READ_NBYTE; in nghttp2_session_mem_recv()
6279 inbound_frame_set_mark(iframe, 4); in nghttp2_session_mem_recv()
6285 iframe->frame.hd.flags &= NGHTTP2_FLAG_ACK; in nghttp2_session_mem_recv()
6287 if (iframe->payloadleft != 8) { in nghttp2_session_mem_recv()
6289 iframe->state = NGHTTP2_IB_FRAME_SIZE_ERROR; in nghttp2_session_mem_recv()
6293 iframe->state = NGHTTP2_IB_READ_NBYTE; in nghttp2_session_mem_recv()
6294 inbound_frame_set_mark(iframe, 8); in nghttp2_session_mem_recv()
6300 iframe->frame.hd.flags = NGHTTP2_FLAG_NONE; in nghttp2_session_mem_recv()
6302 if (iframe->payloadleft < 8) { in nghttp2_session_mem_recv()
6304 iframe->state = NGHTTP2_IB_FRAME_SIZE_ERROR; in nghttp2_session_mem_recv()
6308 iframe->state = NGHTTP2_IB_READ_NBYTE; in nghttp2_session_mem_recv()
6309 inbound_frame_set_mark(iframe, 8); in nghttp2_session_mem_recv()
6328 iframe->frame.hd.type)) { in nghttp2_session_mem_recv()
6334 iframe->state = NGHTTP2_IB_IGN_PAYLOAD; in nghttp2_session_mem_recv()
6341 iframe->state = NGHTTP2_IB_READ_EXTENSION_PAYLOAD; in nghttp2_session_mem_recv()
6345 switch (iframe->frame.hd.type) { in nghttp2_session_mem_recv()
6350 iframe->state = NGHTTP2_IB_IGN_PAYLOAD; in nghttp2_session_mem_recv()
6356 iframe->frame.hd.flags = NGHTTP2_FLAG_NONE; in nghttp2_session_mem_recv()
6357 iframe->frame.ext.payload = &iframe->ext_frame_payload.altsvc; in nghttp2_session_mem_recv()
6361 iframe->state = NGHTTP2_IB_IGN_PAYLOAD; in nghttp2_session_mem_recv()
6365 if (iframe->payloadleft < 2) { in nghttp2_session_mem_recv()
6367 iframe->state = NGHTTP2_IB_FRAME_SIZE_ERROR; in nghttp2_session_mem_recv()
6373 iframe->state = NGHTTP2_IB_READ_NBYTE; in nghttp2_session_mem_recv()
6374 inbound_frame_set_mark(iframe, 2); in nghttp2_session_mem_recv()
6380 iframe->state = NGHTTP2_IB_IGN_PAYLOAD; in nghttp2_session_mem_recv()
6386 iframe->frame.ext.payload = &iframe->ext_frame_payload.origin; in nghttp2_session_mem_recv()
6388 if (session->server || iframe->frame.hd.stream_id || in nghttp2_session_mem_recv()
6389 (iframe->frame.hd.flags & 0xf0)) { in nghttp2_session_mem_recv()
6391 iframe->state = NGHTTP2_IB_IGN_PAYLOAD; in nghttp2_session_mem_recv()
6395 iframe->frame.hd.flags = NGHTTP2_FLAG_NONE; in nghttp2_session_mem_recv()
6397 if (iframe->payloadleft) { in nghttp2_session_mem_recv()
6398 iframe->raw_lbuf = nghttp2_mem_malloc(mem, iframe->payloadleft); in nghttp2_session_mem_recv()
6400 if (iframe->raw_lbuf == NULL) { in nghttp2_session_mem_recv()
6404 nghttp2_buf_wrap_init(&iframe->lbuf, iframe->raw_lbuf, in nghttp2_session_mem_recv()
6405 iframe->payloadleft); in nghttp2_session_mem_recv()
6410 iframe->state = NGHTTP2_IB_READ_ORIGIN_PAYLOAD; in nghttp2_session_mem_recv()
6417 iframe->state = NGHTTP2_IB_IGN_PAYLOAD; in nghttp2_session_mem_recv()
6423 iframe->frame.hd.flags = NGHTTP2_FLAG_NONE; in nghttp2_session_mem_recv()
6424 iframe->frame.ext.payload = in nghttp2_session_mem_recv()
6425 &iframe->ext_frame_payload.priority_update; in nghttp2_session_mem_recv()
6437 if (iframe->payloadleft < 4) { in nghttp2_session_mem_recv()
6439 iframe->state = NGHTTP2_IB_FRAME_SIZE_ERROR; in nghttp2_session_mem_recv()
6444 iframe->payloadleft > sizeof(iframe->raw_sbuf)) { in nghttp2_session_mem_recv()
6446 iframe->state = NGHTTP2_IB_IGN_PAYLOAD; in nghttp2_session_mem_recv()
6452 iframe->state = NGHTTP2_IB_READ_NBYTE; in nghttp2_session_mem_recv()
6453 inbound_frame_set_mark(iframe, iframe->payloadleft); in nghttp2_session_mem_recv()
6459 iframe->state = NGHTTP2_IB_IGN_PAYLOAD; in nghttp2_session_mem_recv()
6467 switch (iframe->state) { in nghttp2_session_mem_recv()
6475 rv = session_call_on_begin_frame(session, &iframe->frame.hd); in nghttp2_session_mem_recv()
6488 readlen = inbound_frame_buf_read(iframe, in, last); in nghttp2_session_mem_recv()
6490 iframe->payloadleft -= readlen; in nghttp2_session_mem_recv()
6493 iframe->payloadleft, nghttp2_buf_mark_avail(&iframe->sbuf)); in nghttp2_session_mem_recv()
6495 if (nghttp2_buf_mark_avail(&iframe->sbuf)) { in nghttp2_session_mem_recv()
6499 switch (iframe->frame.hd.type) { in nghttp2_session_mem_recv()
6501 if (iframe->padlen == 0 && in nghttp2_session_mem_recv()
6502 (iframe->frame.hd.flags & NGHTTP2_FLAG_PADDED)) { in nghttp2_session_mem_recv()
6503 pri_fieldlen = nghttp2_frame_priority_len(iframe->frame.hd.flags); in nghttp2_session_mem_recv()
6504 padlen = inbound_frame_compute_pad(iframe); in nghttp2_session_mem_recv()
6506 (size_t)padlen + pri_fieldlen > 1 + iframe->payloadleft) { in nghttp2_session_mem_recv()
6514 iframe->frame.headers.padlen = (size_t)padlen; in nghttp2_session_mem_recv()
6517 if (iframe->payloadleft < pri_fieldlen) { in nghttp2_session_mem_recv()
6519 iframe->state = NGHTTP2_IB_FRAME_SIZE_ERROR; in nghttp2_session_mem_recv()
6522 iframe->state = NGHTTP2_IB_READ_NBYTE; in nghttp2_session_mem_recv()
6523 inbound_frame_set_mark(iframe, pri_fieldlen); in nghttp2_session_mem_recv()
6527 inbound_frame_set_mark(iframe, 0); in nghttp2_session_mem_recv()
6538 if (iframe->state == NGHTTP2_IB_IGN_ALL) { in nghttp2_session_mem_recv()
6544 session, iframe->frame.hd.stream_id, NGHTTP2_INTERNAL_ERROR); in nghttp2_session_mem_recv()
6548 iframe->state = NGHTTP2_IB_IGN_HEADER_BLOCK; in nghttp2_session_mem_recv()
6553 iframe->state = NGHTTP2_IB_IGN_HEADER_BLOCK; in nghttp2_session_mem_recv()
6557 iframe->state = NGHTTP2_IB_READ_HEADER_BLOCK; in nghttp2_session_mem_recv()
6568 if (iframe->state == NGHTTP2_IB_IGN_ALL) { in nghttp2_session_mem_recv()
6582 if (iframe->state == NGHTTP2_IB_IGN_ALL) { in nghttp2_session_mem_recv()
6590 if (iframe->padlen == 0 && in nghttp2_session_mem_recv()
6591 (iframe->frame.hd.flags & NGHTTP2_FLAG_PADDED)) { in nghttp2_session_mem_recv()
6592 padlen = inbound_frame_compute_pad(iframe); in nghttp2_session_mem_recv()
6594 > 1 + iframe->payloadleft) { in nghttp2_session_mem_recv()
6604 iframe->frame.push_promise.padlen = (size_t)padlen; in nghttp2_session_mem_recv()
6606 if (iframe->payloadleft < 4) { in nghttp2_session_mem_recv()
6608 iframe->state = NGHTTP2_IB_FRAME_SIZE_ERROR; in nghttp2_session_mem_recv()
6612 iframe->state = NGHTTP2_IB_READ_NBYTE; in nghttp2_session_mem_recv()
6614 inbound_frame_set_mark(iframe, 4); in nghttp2_session_mem_recv()
6626 if (iframe->state == NGHTTP2_IB_IGN_ALL) { in nghttp2_session_mem_recv()
6632 session, iframe->frame.push_promise.promised_stream_id, in nghttp2_session_mem_recv()
6637 iframe->state = NGHTTP2_IB_IGN_HEADER_BLOCK; in nghttp2_session_mem_recv()
6642 iframe->state = NGHTTP2_IB_IGN_HEADER_BLOCK; in nghttp2_session_mem_recv()
6646 iframe->state = NGHTTP2_IB_READ_HEADER_BLOCK; in nghttp2_session_mem_recv()
6655 if (iframe->state == NGHTTP2_IB_IGN_ALL) { in nghttp2_session_mem_recv()
6666 debuglen = iframe->frame.hd.length - 8; in nghttp2_session_mem_recv()
6669 iframe->raw_lbuf = nghttp2_mem_malloc(mem, debuglen); in nghttp2_session_mem_recv()
6671 if (iframe->raw_lbuf == NULL) { in nghttp2_session_mem_recv()
6675 nghttp2_buf_wrap_init(&iframe->lbuf, iframe->raw_lbuf, debuglen); in nghttp2_session_mem_recv()
6680 iframe->state = NGHTTP2_IB_READ_GOAWAY_DEBUG; in nghttp2_session_mem_recv()
6690 if (iframe->state == NGHTTP2_IB_IGN_ALL) { in nghttp2_session_mem_recv()
6700 origin_len = nghttp2_get_uint16(iframe->sbuf.pos); in nghttp2_session_mem_recv()
6704 if (origin_len > iframe->payloadleft) { in nghttp2_session_mem_recv()
6706 iframe->state = NGHTTP2_IB_FRAME_SIZE_ERROR; in nghttp2_session_mem_recv()
6710 if (iframe->frame.hd.length > 2) { in nghttp2_session_mem_recv()
6711 iframe->raw_lbuf = in nghttp2_session_mem_recv()
6712 nghttp2_mem_malloc(mem, iframe->frame.hd.length - 2); in nghttp2_session_mem_recv()
6714 if (iframe->raw_lbuf == NULL) { in nghttp2_session_mem_recv()
6718 nghttp2_buf_wrap_init(&iframe->lbuf, iframe->raw_lbuf, in nghttp2_session_mem_recv()
6719 iframe->frame.hd.length); in nghttp2_session_mem_recv()
6724 iframe->state = NGHTTP2_IB_READ_ALTSVC_PAYLOAD; in nghttp2_session_mem_recv()
6729 nghttp2_get_uint32(iframe->sbuf.pos) & NGHTTP2_STREAM_ID_MASK); in nghttp2_session_mem_recv()
6753 if (iframe->state == NGHTTP2_IB_READ_HEADER_BLOCK) { in nghttp2_session_mem_recv()
6760 readlen = inbound_frame_payload_readlen(iframe, in, last); in nghttp2_session_mem_recv()
6763 iframe->payloadleft - readlen); in nghttp2_session_mem_recv()
6766 iframe, iframe->payloadleft - readlen, readlen); in nghttp2_session_mem_recv()
6773 trail_padlen = nghttp2_frame_trail_padlen(&iframe->frame, iframe->padlen); in nghttp2_session_mem_recv()
6775 final = (iframe->frame.hd.flags & NGHTTP2_FLAG_END_HEADERS) && in nghttp2_session_mem_recv()
6776 iframe->payloadleft - (size_t)data_readlen == trail_padlen; in nghttp2_session_mem_recv()
6784 inflate_header_block(session, &iframe->frame, &hd_proclen, in nghttp2_session_mem_recv()
6786 iframe->state == NGHTTP2_IB_READ_HEADER_BLOCK); in nghttp2_session_mem_recv()
6792 if (iframe->state == NGHTTP2_IB_IGN_ALL) { in nghttp2_session_mem_recv()
6798 iframe->payloadleft -= hd_proclen; in nghttp2_session_mem_recv()
6808 iframe->payloadleft -= hd_proclen; in nghttp2_session_mem_recv()
6813 iframe->frame.hd.type == NGHTTP2_PUSH_PROMISE in nghttp2_session_mem_recv()
6814 ? iframe->frame.push_promise.promised_stream_id in nghttp2_session_mem_recv()
6815 : iframe->frame.hd.stream_id, in nghttp2_session_mem_recv()
6821 iframe->state = NGHTTP2_IB_IGN_HEADER_BLOCK; in nghttp2_session_mem_recv()
6826 iframe->payloadleft -= readlen; in nghttp2_session_mem_recv()
6830 if (iframe->payloadleft == 0) { in nghttp2_session_mem_recv()
6834 iframe->state = NGHTTP2_IB_IGN_PAYLOAD; in nghttp2_session_mem_recv()
6840 iframe->payloadleft -= readlen; in nghttp2_session_mem_recv()
6843 if (iframe->payloadleft) { in nghttp2_session_mem_recv()
6847 if ((iframe->frame.hd.flags & NGHTTP2_FLAG_END_HEADERS) == 0) { in nghttp2_session_mem_recv()
6849 inbound_frame_set_mark(iframe, NGHTTP2_FRAME_HDLEN); in nghttp2_session_mem_recv()
6851 iframe->padlen = 0; in nghttp2_session_mem_recv()
6853 if (iframe->state == NGHTTP2_IB_READ_HEADER_BLOCK) { in nghttp2_session_mem_recv()
6854 iframe->state = NGHTTP2_IB_EXPECT_CONTINUATION; in nghttp2_session_mem_recv()
6856 iframe->state = NGHTTP2_IB_IGN_CONTINUATION; in nghttp2_session_mem_recv()
6859 if (iframe->state == NGHTTP2_IB_READ_HEADER_BLOCK) { in nghttp2_session_mem_recv()
6872 readlen = inbound_frame_payload_readlen(iframe, in, last); in nghttp2_session_mem_recv()
6873 iframe->payloadleft -= readlen; in nghttp2_session_mem_recv()
6877 iframe->payloadleft); in nghttp2_session_mem_recv()
6879 if (iframe->payloadleft) { in nghttp2_session_mem_recv()
6883 switch (iframe->frame.hd.type) { in nghttp2_session_mem_recv()
6905 assert(iframe->state == NGHTTP2_IB_IGN_ALL); in nghttp2_session_mem_recv()
6911 readlen = inbound_frame_buf_read(iframe, in, last); in nghttp2_session_mem_recv()
6912 iframe->payloadleft -= readlen; in nghttp2_session_mem_recv()
6916 iframe->payloadleft); in nghttp2_session_mem_recv()
6918 if (nghttp2_buf_mark_avail(&iframe->sbuf)) { in nghttp2_session_mem_recv()
6923 inbound_frame_set_settings_entry(iframe); in nghttp2_session_mem_recv()
6925 if (iframe->payloadleft) { in nghttp2_session_mem_recv()
6926 inbound_frame_set_mark(iframe, NGHTTP2_FRAME_SETTINGS_ENTRY_LENGTH); in nghttp2_session_mem_recv()
6936 if (iframe->state == NGHTTP2_IB_IGN_ALL) { in nghttp2_session_mem_recv()
6946 readlen = inbound_frame_payload_readlen(iframe, in, last); in nghttp2_session_mem_recv()
6949 iframe->lbuf.last = nghttp2_cpymem(iframe->lbuf.last, in, readlen); in nghttp2_session_mem_recv()
6951 iframe->payloadleft -= readlen; in nghttp2_session_mem_recv()
6956 iframe->payloadleft); in nghttp2_session_mem_recv()
6958 if (iframe->payloadleft) { in nghttp2_session_mem_recv()
6959 assert(nghttp2_buf_avail(&iframe->lbuf) > 0); in nghttp2_session_mem_recv()
6970 if (iframe->state == NGHTTP2_IB_IGN_ALL) { in nghttp2_session_mem_recv()
6980 if (iframe->state == NGHTTP2_IB_EXPECT_CONTINUATION) { in nghttp2_session_mem_recv()
6987 readlen = inbound_frame_buf_read(iframe, in, last); in nghttp2_session_mem_recv()
6990 if (nghttp2_buf_mark_avail(&iframe->sbuf)) { in nghttp2_session_mem_recv()
6994 nghttp2_frame_unpack_frame_hd(&cont_hd, iframe->sbuf.pos); in nghttp2_session_mem_recv()
6995 iframe->payloadleft = cont_hd.length; in nghttp2_session_mem_recv()
7001 cont_hd.stream_id != iframe->frame.hd.stream_id) { in nghttp2_session_mem_recv()
7004 iframe->frame.hd.stream_id, NGHTTP2_CONTINUATION, in nghttp2_session_mem_recv()
7018 iframe->frame.hd.flags = in nghttp2_session_mem_recv()
7019 (uint8_t)(iframe->frame.hd.flags | in nghttp2_session_mem_recv()
7021 iframe->frame.hd.length += cont_hd.length; in nghttp2_session_mem_recv()
7025 if (iframe->state == NGHTTP2_IB_EXPECT_CONTINUATION) { in nghttp2_session_mem_recv()
7026 iframe->state = NGHTTP2_IB_READ_HEADER_BLOCK; in nghttp2_session_mem_recv()
7034 iframe->state = NGHTTP2_IB_IGN_HEADER_BLOCK; in nghttp2_session_mem_recv()
7041 readlen = inbound_frame_buf_read(iframe, in, last); in nghttp2_session_mem_recv()
7043 iframe->payloadleft -= readlen; in nghttp2_session_mem_recv()
7046 iframe->payloadleft, nghttp2_buf_mark_avail(&iframe->sbuf)); in nghttp2_session_mem_recv()
7048 if (nghttp2_buf_mark_avail(&iframe->sbuf)) { in nghttp2_session_mem_recv()
7058 if (iframe->state == NGHTTP2_IB_IGN_ALL) { in nghttp2_session_mem_recv()
7064 nghttp2_session_consume(session, iframe->frame.hd.stream_id, readlen); in nghttp2_session_mem_recv()
7070 if (iframe->state == NGHTTP2_IB_IGN_ALL) { in nghttp2_session_mem_recv()
7074 stream = nghttp2_session_get_stream(session, iframe->frame.hd.stream_id); in nghttp2_session_mem_recv()
7078 iframe->payloadleft || in nghttp2_session_mem_recv()
7079 (iframe->frame.hd.flags & NGHTTP2_FLAG_END_STREAM) == 0); in nghttp2_session_mem_recv()
7087 padlen = inbound_frame_compute_pad(iframe); in nghttp2_session_mem_recv()
7097 iframe->frame.data.padlen = (size_t)padlen; in nghttp2_session_mem_recv()
7099 iframe->state = NGHTTP2_IB_READ_DATA; in nghttp2_session_mem_recv()
7103 stream = nghttp2_session_get_stream(session, iframe->frame.hd.stream_id); in nghttp2_session_mem_recv()
7107 iframe->state = NGHTTP2_IB_IGN_DATA; in nghttp2_session_mem_recv()
7113 readlen = inbound_frame_payload_readlen(iframe, in, last); in nghttp2_session_mem_recv()
7114 iframe->payloadleft -= readlen; in nghttp2_session_mem_recv()
7118 iframe->payloadleft); in nghttp2_session_mem_recv()
7129 if (iframe->state == NGHTTP2_IB_IGN_ALL) { in nghttp2_session_mem_recv()
7135 iframe->payloadleft || in nghttp2_session_mem_recv()
7136 (iframe->frame.hd.flags & NGHTTP2_FLAG_END_STREAM) == 0); in nghttp2_session_mem_recv()
7142 iframe, iframe->payloadleft, readlen); in nghttp2_session_mem_recv()
7153 rv = nghttp2_session_consume(session, iframe->frame.hd.stream_id, in nghttp2_session_mem_recv()
7160 if (iframe->state == NGHTTP2_IB_IGN_ALL) { in nghttp2_session_mem_recv()
7179 if (iframe->state == NGHTTP2_IB_IGN_DATA) { in nghttp2_session_mem_recv()
7185 session, iframe->frame.hd.stream_id, NGHTTP2_PROTOCOL_ERROR); in nghttp2_session_mem_recv()
7190 iframe->state = NGHTTP2_IB_IGN_DATA; in nghttp2_session_mem_recv()
7196 session, iframe->frame.hd.flags, iframe->frame.hd.stream_id, in nghttp2_session_mem_recv()
7209 if (iframe->payloadleft) { in nghttp2_session_mem_recv()
7224 readlen = inbound_frame_payload_readlen(iframe, in, last); in nghttp2_session_mem_recv()
7225 iframe->payloadleft -= readlen; in nghttp2_session_mem_recv()
7229 iframe->payloadleft); in nghttp2_session_mem_recv()
7240 if (iframe->state == NGHTTP2_IB_IGN_ALL) { in nghttp2_session_mem_recv()
7253 if (iframe->state == NGHTTP2_IB_IGN_ALL) { in nghttp2_session_mem_recv()
7259 if (iframe->payloadleft) { in nghttp2_session_mem_recv()
7271 readlen = inbound_frame_payload_readlen(iframe, in, last); in nghttp2_session_mem_recv()
7272 iframe->payloadleft -= readlen; in nghttp2_session_mem_recv()
7276 iframe->payloadleft); in nghttp2_session_mem_recv()
7288 iframe->state = NGHTTP2_IB_IGN_PAYLOAD; in nghttp2_session_mem_recv()
7294 if (iframe->payloadleft > 0) { in nghttp2_session_mem_recv()
7309 readlen = inbound_frame_payload_readlen(iframe, in, last); in nghttp2_session_mem_recv()
7311 iframe->lbuf.last = nghttp2_cpymem(iframe->lbuf.last, in, readlen); in nghttp2_session_mem_recv()
7313 iframe->payloadleft -= readlen; in nghttp2_session_mem_recv()
7318 iframe->payloadleft); in nghttp2_session_mem_recv()
7320 if (iframe->payloadleft) { in nghttp2_session_mem_recv()
7321 assert(nghttp2_buf_avail(&iframe->lbuf) > 0); in nghttp2_session_mem_recv()
7337 readlen = inbound_frame_payload_readlen(iframe, in, last); in nghttp2_session_mem_recv()
7340 iframe->lbuf.last = nghttp2_cpymem(iframe->lbuf.last, in, readlen); in nghttp2_session_mem_recv()
7342 iframe->payloadleft -= readlen; in nghttp2_session_mem_recv()
7347 iframe->payloadleft); in nghttp2_session_mem_recv()
7349 if (iframe->payloadleft) { in nghttp2_session_mem_recv()
7350 assert(nghttp2_buf_avail(&iframe->lbuf) > 0); in nghttp2_session_mem_recv()
7361 if (iframe->state == NGHTTP2_IB_IGN_ALL) { in nghttp2_session_mem_recv()