Lines Matching refs:cf

156 #define CF_CTX_CALL_DATA(cf)  \  argument
157 ((struct cf_h2_ctx *)(cf)->ctx)->call_data
194 static CURLcode h2_progress_egress(struct Curl_cfilter *cf,
279 static int32_t cf_h2_get_desired_local_win(struct Curl_cfilter *cf, in cf_h2_get_desired_local_win() argument
282 (void)cf; in cf_h2_get_desired_local_win()
293 static CURLcode cf_h2_update_local_win(struct Curl_cfilter *cf, in cf_h2_update_local_win() argument
298 struct cf_h2_ctx *ctx = cf->ctx; in cf_h2_update_local_win()
302 dwsize = paused ? 0 : cf_h2_get_desired_local_win(cf, data); in cf_h2_update_local_win()
315 CURL_TRC_CF(data, cf, "[%d] local window update by %d", in cf_h2_update_local_win()
327 CURL_TRC_CF(data, cf, "[%d] local window size now %d", in cf_h2_update_local_win()
336 static CURLcode cf_h2_update_local_win(struct Curl_cfilter *cf, in cf_h2_update_local_win() argument
341 (void)cf; in cf_h2_update_local_win()
352 static void drain_stream(struct Curl_cfilter *cf, in drain_stream() argument
358 (void)cf; in drain_stream()
364 CURL_TRC_CF(data, cf, "[%d] DRAIN select_bits=%x", in drain_stream()
371 static CURLcode http2_data_setup(struct Curl_cfilter *cf, in http2_data_setup() argument
375 struct cf_h2_ctx *ctx = cf->ctx; in http2_data_setup()
378 (void)cf; in http2_data_setup()
399 static void http2_data_done(struct Curl_cfilter *cf, struct Curl_easy *data) in http2_data_done() argument
401 struct cf_h2_ctx *ctx = cf->ctx; in http2_data_done()
415 CURL_TRC_CF(data, cf, "[%d] premature DATA_DONE, RST stream", in http2_data_done()
431 static int h2_client_new(struct Curl_cfilter *cf, in h2_client_new() argument
434 struct cf_h2_ctx *ctx = cf->ctx; in h2_client_new()
450 rc = nghttp2_session_client_new3(&ctx->h2, cbs, cf, o, &mem); in h2_client_new()
459 struct Curl_cfilter *cf = reader_ctx; in nw_in_reader() local
460 struct Curl_easy *data = CF_DATA_CURRENT(cf); in nw_in_reader()
462 return Curl_conn_cf_recv(cf->next, data, (char *)buf, buflen, err); in nw_in_reader()
469 struct Curl_cfilter *cf = writer_ctx; in nw_out_writer() local
470 struct Curl_easy *data = CF_DATA_CURRENT(cf); in nw_out_writer()
473 ssize_t nwritten = Curl_conn_cf_send(cf->next, data, (const char *)buf, in nw_out_writer()
476 CURL_TRC_CF(data, cf, "[0] egress: wrote %zd bytes", nwritten); in nw_out_writer()
507 static CURLcode cf_h2_ctx_open(struct Curl_cfilter *cf, in cf_h2_ctx_open() argument
510 struct cf_h2_ctx *ctx = cf->ctx; in cf_h2_ctx_open()
541 rc = h2_client_new(cf, cbs); in cf_h2_ctx_open()
562 result = http2_data_setup(cf, data, &stream); in cf_h2_ctx_open()
585 CURL_TRC_CF(data, cf, "created session via Upgrade"); in cf_h2_ctx_open()
613 CURL_TRC_CF(data, cf, "[0] created h2 session%s", in cf_h2_ctx_open()
636 static int h2_process_pending_input(struct Curl_cfilter *cf, in h2_process_pending_input() argument
640 struct cf_h2_ctx *ctx = cf->ctx; in h2_process_pending_input()
660 CURL_TRC_CF(data, cf, "process_pending_input: %zu bytes left " in h2_process_pending_input()
670 connclose(cf->conn, "http/2: No new requests allowed"); in h2_process_pending_input()
683 static bool http2_connisalive(struct Curl_cfilter *cf, struct Curl_easy *data, in http2_connisalive() argument
686 struct cf_h2_ctx *ctx = cf->ctx; in http2_connisalive()
690 if(!cf->next || !cf->next->cft->is_alive(cf->next, data, input_pending)) in http2_connisalive()
701 nread = Curl_bufq_slurp(&ctx->inbufq, nw_in_reader, cf, &result); in http2_connisalive()
703 CURL_TRC_CF(data, cf, "%zd bytes stray data read before trying " in http2_connisalive()
705 if(h2_process_pending_input(cf, data, &result) < 0) in http2_connisalive()
721 static CURLcode http2_send_ping(struct Curl_cfilter *cf, in http2_send_ping() argument
724 struct cf_h2_ctx *ctx = cf->ctx; in http2_send_ping()
752 static CURLcode nw_out_flush(struct Curl_cfilter *cf, in nw_out_flush() argument
755 struct cf_h2_ctx *ctx = cf->ctx; in nw_out_flush()
763 nwritten = Curl_bufq_pass(&ctx->outbufq, nw_out_writer, cf, &result); in nw_out_flush()
766 CURL_TRC_CF(data, cf, "flush nw send buffer(%zu) -> EAGAIN", in nw_out_flush()
784 struct Curl_cfilter *cf = userp; in send_callback() local
785 struct cf_h2_ctx *ctx = cf->ctx; in send_callback()
786 struct Curl_easy *data = CF_DATA_CURRENT(cf); in send_callback()
794 if(!cf->connected) in send_callback()
798 nw_out_writer, cf, &result); in send_callback()
874 static struct Curl_easy *h2_duphandle(struct Curl_cfilter *cf, in h2_duphandle() argument
880 http2_data_setup(cf, second, &second_stream); in h2_duphandle()
940 static void discard_newhandle(struct Curl_cfilter *cf, in discard_newhandle() argument
943 http2_data_done(cf, newhandle); in discard_newhandle()
947 static int push_promise(struct Curl_cfilter *cf, in push_promise() argument
951 struct cf_h2_ctx *ctx = cf->ctx; in push_promise()
954 CURL_TRC_CF(data, cf, "[%d] PUSH_PROMISE received", in push_promise()
963 struct Curl_easy *newhandle = h2_duphandle(cf, data); in push_promise()
971 CURL_TRC_CF(data, cf, "Got PUSH_PROMISE, ask application"); in push_promise()
976 discard_newhandle(cf, newhandle); in push_promise()
987 discard_newhandle(cf, newhandle); in push_promise()
992 result = http2_data_setup(cf, newhandle, &newstream); in push_promise()
995 discard_newhandle(cf, newhandle); in push_promise()
1013 discard_newhandle(cf, newhandle); in push_promise()
1023 rc = Curl_multi_add_perform(data->multi, newhandle, cf->conn); in push_promise()
1026 discard_newhandle(cf, newhandle); in push_promise()
1047 CURL_TRC_CF(data, cf, "Got PUSH_PROMISE, ignore it"); in push_promise()
1054 static void h2_xfer_write_resp_hd(struct Curl_cfilter *cf, in h2_xfer_write_resp_hd() argument
1064 stream->xfer_result = cf_h2_update_local_win(cf, data, stream, FALSE); in h2_xfer_write_resp_hd()
1066 CURL_TRC_CF(data, cf, "[%d] error %d writing %zu bytes of headers", in h2_xfer_write_resp_hd()
1071 static void h2_xfer_write_resp(struct Curl_cfilter *cf, in h2_xfer_write_resp() argument
1081 stream->xfer_result = cf_h2_update_local_win(cf, data, stream, FALSE); in h2_xfer_write_resp()
1084 struct cf_h2_ctx *ctx = cf->ctx; in h2_xfer_write_resp()
1085 CURL_TRC_CF(data, cf, "[%d] error %d writing %zu bytes of data, " in h2_xfer_write_resp()
1093 static CURLcode on_stream_frame(struct Curl_cfilter *cf, in on_stream_frame() argument
1097 struct cf_h2_ctx *ctx = cf->ctx; in on_stream_frame()
1103 CURL_TRC_CF(data, cf, "[%d] No stream_ctx set", stream_id); in on_stream_frame()
1109 CURL_TRC_CF(data, cf, "[%d] DATA, window=%d/%d", in on_stream_frame()
1144 h2_xfer_write_resp_hd(cf, data, stream, STRCONST("\r\n"), stream->closed); in on_stream_frame()
1149 drain_stream(cf, data, stream); in on_stream_frame()
1152 rv = push_promise(cf, data, &frame->push_promise); in on_stream_frame()
1161 CURL_TRC_CF(data, cf, "[%d] fail in PUSH_PROMISE received", in on_stream_frame()
1172 drain_stream(cf, data, stream); in on_stream_frame()
1177 drain_stream(cf, data, stream); in on_stream_frame()
1196 CURL_TRC_CF(data, cf, "[%d] EOS frame with unfinished upload and " in on_stream_frame()
1203 drain_stream(cf, data, stream); in on_stream_frame()
1283 struct Curl_cfilter *cf = userp; in on_frame_send() local
1284 struct Curl_easy *data = CF_DATA_CURRENT(cf); in on_frame_send()
1288 if(data && Curl_trc_cf_is_verbose(cf, data)) { in on_frame_send()
1293 CURL_TRC_CF(data, cf, "[%d] -> %s", frame->hd.stream_id, buffer); in on_frame_send()
1302 struct Curl_cfilter *cf = userp; in on_frame_recv() local
1303 struct cf_h2_ctx *ctx = cf->ctx; in on_frame_recv()
1304 struct Curl_easy *data = CF_DATA_CURRENT(cf), *data_s; in on_frame_recv()
1309 if(Curl_trc_cf_is_verbose(cf, data)) { in on_frame_recv()
1314 CURL_TRC_CF(data, cf, "[%d] <- %s",frame->hd.stream_id, buffer); in on_frame_recv()
1329 CURL_TRC_CF(data, cf, "[0] MAX_CONCURRENT_STREAMS: %d", in on_frame_recv()
1331 CURL_TRC_CF(data, cf, "[0] ENABLE_PUSH: %s", in on_frame_recv()
1335 CURL_TRC_CF(data, cf, "[0] notify MAX_CONCURRENT_STREAMS: %u", in on_frame_recv()
1347 drain_stream(cf, data, stream); in on_frame_recv()
1370 CURL_TRC_CF(data, cf, "[%d] No Curl_easy associated", stream_id); in on_frame_recv()
1374 return on_stream_frame(cf, data_s, frame) ? NGHTTP2_ERR_CALLBACK_FAILURE : 0; in on_frame_recv()
1381 struct Curl_cfilter *cf = userp; in on_data_chunk_recv() local
1382 struct cf_h2_ctx *ctx = cf->ctx; in on_data_chunk_recv()
1388 DEBUGASSERT(CF_DATA_CURRENT(cf)); in on_data_chunk_recv()
1396 CURL_TRC_CF(CF_DATA_CURRENT(cf), cf, "[%d] Data for unknown", in on_data_chunk_recv()
1407 h2_xfer_write_resp(cf, data_s, stream, (char *)mem, len, FALSE); in on_data_chunk_recv()
1417 struct Curl_cfilter *cf = userp; in on_stream_close() local
1418 struct cf_h2_ctx *ctx = cf->ctx; in on_stream_close()
1419 struct Curl_easy *data_s, *call_data = CF_DATA_CURRENT(cf); in on_stream_close()
1429 CURL_TRC_CF(call_data, cf, in on_stream_close()
1437 CURL_TRC_CF(call_data, cf, in on_stream_close()
1444 CURL_TRC_CF(data_s, cf, in on_stream_close()
1456 CURL_TRC_CF(data_s, cf, "[%d] RESET: %s (err %d)", in on_stream_close()
1459 CURL_TRC_CF(data_s, cf, "[%d] CLOSED", stream_id); in on_stream_close()
1460 drain_stream(cf, data_s, stream); in on_stream_close()
1475 struct Curl_cfilter *cf = userp; in on_begin_headers() local
1476 struct cf_h2_ctx *ctx = cf->ctx; in on_begin_headers()
1480 (void)cf; in on_begin_headers()
1505 struct Curl_cfilter *cf = userp; in on_header() local
1506 struct cf_h2_ctx *ctx = cf->ctx; in on_header()
1536 char *check = aprintf("%s:%d", cf->conn->host.name, in on_header()
1537 cf->conn->remote_port); in on_header()
1542 ((cf->conn->remote_port != cf->conn->given->defport) || in on_header()
1543 !strcasecompare(cf->conn->host.name, (const char *)value))) { in on_header()
1592 CURL_TRC_CF(data_s, cf, "[%d] trailer: %.*s: %.*s", in on_header()
1623 h2_xfer_write_resp_hd(cf, data_s, stream, Curl_dyn_ptr(&ctx->scratch), in on_header()
1628 if(CF_DATA_CURRENT(cf) != data_s) in on_header()
1631 CURL_TRC_CF(data_s, cf, "[%d] status: HTTP/2 %03d", in on_header()
1648 h2_xfer_write_resp_hd(cf, data_s, stream, Curl_dyn_ptr(&ctx->scratch), in on_header()
1653 if(CF_DATA_CURRENT(cf) != data_s) in on_header()
1656 CURL_TRC_CF(data_s, cf, "[%d] header: %.*s: %.*s", in on_header()
1669 struct Curl_cfilter *cf = userp; in req_body_read_callback() local
1670 struct cf_h2_ctx *ctx = cf->ctx; in req_body_read_callback()
1677 (void)cf; in req_body_read_callback()
1700 CURL_TRC_CF(data_s, cf, "[%d] req_body_read(len=%zu) eos=%d -> %zd, %d", in req_body_read_callback()
1716 struct Curl_cfilter *cf = userp; in error_callback() local
1717 struct Curl_easy *data = CF_DATA_CURRENT(cf); in error_callback()
1764 static ssize_t http2_handle_stream_close(struct Curl_cfilter *cf, in http2_handle_stream_close() argument
1772 CURL_TRC_CF(data, cf, "[%d] REFUSED_STREAM, try again on a new " in http2_handle_stream_close()
1774 connclose(cf->conn, "REFUSED_STREAM"); /* do not use this anymore */ in http2_handle_stream_close()
1781 CURL_TRC_CF(data, cf, "[%d] error after response headers, but we did " in http2_handle_stream_close()
1843 CURL_TRC_CF(data, cf, "handle_stream_close -> %zd, %d", rv, *err); in http2_handle_stream_close()
1886 static CURLcode h2_progress_egress(struct Curl_cfilter *cf, in h2_progress_egress() argument
1889 struct cf_h2_ctx *ctx = cf->ctx; in h2_progress_egress()
1901 CURL_TRC_CF(data, cf, "[%d] Queuing PRIORITY", stream->id); in h2_progress_egress()
1915 CURL_TRC_CF(data, cf, "nghttp2_session_send error (%s)%d", in h2_progress_egress()
1922 if(!cf->connected && !cf->conn->connect_only) in h2_progress_egress()
1924 return nw_out_flush(cf, data); in h2_progress_egress()
1927 static ssize_t stream_recv(struct Curl_cfilter *cf, struct Curl_easy *data, in stream_recv() argument
1931 struct cf_h2_ctx *ctx = cf->ctx; in stream_recv()
1937 CURL_TRC_CF(data, cf, "[%d] xfer write failed", stream->id); in stream_recv()
1942 CURL_TRC_CF(data, cf, "[%d] returning CLOSE", stream->id); in stream_recv()
1943 nread = http2_handle_stream_close(cf, data, stream, err); in stream_recv()
1948 CURL_TRC_CF(data, cf, "[%d] returning ERR", stream->id); in stream_recv()
1954 CURL_TRC_CF(data, cf, "[%d] stream_recv(len=%zu) -> %zd, %d", in stream_recv()
1959 static CURLcode h2_progress_ingress(struct Curl_cfilter *cf, in h2_progress_ingress() argument
1963 struct cf_h2_ctx *ctx = cf->ctx; in h2_progress_ingress()
1970 CURL_TRC_CF(data, cf, "Process %zu bytes in connection buffer", in h2_progress_ingress()
1972 if(h2_process_pending_input(cf, data, &result) < 0) in h2_progress_ingress()
1986 if(!cf->next || !cf->next->cft->has_data_pending(cf->next, data)) in h2_progress_ingress()
1987 drain_stream(cf, data, stream); in h2_progress_ingress()
1991 nread = Curl_bufq_sipn(&ctx->inbufq, 0, nw_in_reader, cf, &result); in h2_progress_ingress()
2001 CURL_TRC_CF(data, cf, "[0] ingress: connection closed"); in h2_progress_ingress()
2006 CURL_TRC_CF(data, cf, "[0] ingress: read %zd bytes", nread); in h2_progress_ingress()
2011 if(h2_process_pending_input(cf, data, &result)) in h2_progress_ingress()
2013 CURL_TRC_CF(data, cf, "[0] progress ingress: inbufg=%zu", in h2_progress_ingress()
2018 connclose(cf->conn, "GOAWAY received"); in h2_progress_ingress()
2021 CURL_TRC_CF(data, cf, "[0] progress ingress: done"); in h2_progress_ingress()
2025 static ssize_t cf_h2_recv(struct Curl_cfilter *cf, struct Curl_easy *data, in cf_h2_recv() argument
2028 struct cf_h2_ctx *ctx = cf->ctx; in cf_h2_recv()
2045 CF_DATA_SAVE(save, cf, data); in cf_h2_recv()
2047 nread = stream_recv(cf, data, stream, buf, len, err); in cf_h2_recv()
2052 *err = h2_progress_ingress(cf, data, len); in cf_h2_recv()
2056 nread = stream_recv(cf, data, stream, buf, len, err); in cf_h2_recv()
2078 CURL_TRC_CF(data, cf, "[%d] DRAIN closed stream", stream->id); in cf_h2_recv()
2079 drain_stream(cf, data, stream); in cf_h2_recv()
2084 result = h2_progress_egress(cf, data); in cf_h2_recv()
2090 drain_stream(cf, data, stream); in cf_h2_recv()
2096 CURL_TRC_CF(data, cf, "[%d] cf_recv(len=%zu) -> %zd %d, " in cf_h2_recv()
2106 CF_DATA_RESTORE(cf, save); in cf_h2_recv()
2110 static ssize_t cf_h2_body_send(struct Curl_cfilter *cf, in cf_h2_body_send() argument
2116 struct cf_h2_ctx *ctx = cf->ctx; in cf_h2_body_send()
2126 CURL_TRC_CF(data, cf, "[%d] discarding data" in cf_h2_body_send()
2158 struct Curl_cfilter *cf, struct Curl_easy *data, in h2_submit() argument
2162 struct cf_h2_ctx *ctx = cf->ctx; in h2_submit()
2175 *err = http2_data_setup(cf, data, &stream); in h2_submit()
2207 CURL_TRC_CF(data, cf, "send request NOT allowed (via nghttp2)"); in h2_submit()
2225 CURL_TRC_CF(data, cf, "send: nghttp2_submit_request error (%s)%u", in h2_submit()
2259 ssize_t n = cf_h2_body_send(cf, data, stream, body, bodylen, eos, err); in h2_submit()
2272 CURL_TRC_CF(data, cf, "[%d] submit -> %zd, %d", in h2_submit()
2280 static ssize_t cf_h2_send(struct Curl_cfilter *cf, struct Curl_easy *data, in cf_h2_send() argument
2284 struct cf_h2_ctx *ctx = cf->ctx; in cf_h2_send()
2290 CF_DATA_SAVE(save, cf, data); in cf_h2_send()
2293 nwritten = h2_submit(&stream, cf, data, buf, len, eos, err); in cf_h2_send()
2305 nwritten = cf_h2_body_send(cf, data, stream, buf, 0, eos, err); in cf_h2_send()
2306 CURL_TRC_CF(data, cf, "[%d] cf_body_send last CHUNK -> %zd, %d, eos=%d", in cf_h2_send()
2314 nwritten = cf_h2_body_send(cf, data, stream, buf, len, eos, err); in cf_h2_send()
2315 CURL_TRC_CF(data, cf, "[%d] cf_body_send(len=%zu) -> %zd, %d, eos=%d", in cf_h2_send()
2321 result = h2_progress_egress(cf, data); in cf_h2_send()
2341 nwritten = http2_handle_stream_close(cf, data, stream, err); in cf_h2_send()
2344 CURL_TRC_CF(data, cf, "send: nothing to do in this session"); in cf_h2_send()
2352 CURL_TRC_CF(data, cf, "[%d] cf_send(len=%zu) -> %zd, %d, " in cf_h2_send()
2364 CURL_TRC_CF(data, cf, "cf_send(len=%zu) -> %zd, %d, " in cf_h2_send()
2370 CF_DATA_RESTORE(cf, save); in cf_h2_send()
2374 static CURLcode cf_h2_flush(struct Curl_cfilter *cf, in cf_h2_flush() argument
2377 struct cf_h2_ctx *ctx = cf->ctx; in cf_h2_flush()
2382 CF_DATA_SAVE(save, cf, data); in cf_h2_flush()
2392 result = h2_progress_egress(cf, data); in cf_h2_flush()
2396 CURL_TRC_CF(data, cf, "[%d] flush -> %d, " in cf_h2_flush()
2407 CURL_TRC_CF(data, cf, "flush -> %d, " in cf_h2_flush()
2412 CF_DATA_RESTORE(cf, save); in cf_h2_flush()
2416 static void cf_h2_adjust_pollset(struct Curl_cfilter *cf, in cf_h2_adjust_pollset() argument
2420 struct cf_h2_ctx *ctx = cf->ctx; in cf_h2_adjust_pollset()
2428 sock = Curl_conn_cf_get_socket(cf, data); in cf_h2_adjust_pollset()
2434 CF_DATA_SAVE(save, cf, data); in cf_h2_adjust_pollset()
2445 CF_DATA_RESTORE(cf, save); in cf_h2_adjust_pollset()
2447 else if(ctx->sent_goaway && !cf->shutdown) { in cf_h2_adjust_pollset()
2449 CF_DATA_SAVE(save, cf, data); in cf_h2_adjust_pollset()
2454 CF_DATA_RESTORE(cf, save); in cf_h2_adjust_pollset()
2458 static CURLcode cf_h2_connect(struct Curl_cfilter *cf, in cf_h2_connect() argument
2462 struct cf_h2_ctx *ctx = cf->ctx; in cf_h2_connect()
2467 if(cf->connected) { in cf_h2_connect()
2473 if(!cf->next->connected) { in cf_h2_connect()
2474 result = Curl_conn_cf_connect(cf->next, data, blocking, done); in cf_h2_connect()
2481 CF_DATA_SAVE(save, cf, data); in cf_h2_connect()
2484 result = cf_h2_ctx_open(cf, data); in cf_h2_connect()
2491 result = h2_progress_ingress(cf, data, H2_CHUNK_SIZE); in cf_h2_connect()
2498 result = h2_progress_egress(cf, data); in cf_h2_connect()
2505 cf->connected = TRUE; in cf_h2_connect()
2509 CURL_TRC_CF(data, cf, "cf_connect() -> %d, %d, ", result, *done); in cf_h2_connect()
2510 CF_DATA_RESTORE(cf, save); in cf_h2_connect()
2514 static void cf_h2_close(struct Curl_cfilter *cf, struct Curl_easy *data) in cf_h2_close() argument
2516 struct cf_h2_ctx *ctx = cf->ctx; in cf_h2_close()
2521 CF_DATA_SAVE(save, cf, data); in cf_h2_close()
2523 CF_DATA_RESTORE(cf, save); in cf_h2_close()
2524 cf->connected = FALSE; in cf_h2_close()
2526 if(cf->next) in cf_h2_close()
2527 cf->next->cft->do_close(cf->next, data); in cf_h2_close()
2530 static void cf_h2_destroy(struct Curl_cfilter *cf, struct Curl_easy *data) in cf_h2_destroy() argument
2532 struct cf_h2_ctx *ctx = cf->ctx; in cf_h2_destroy()
2537 cf->ctx = NULL; in cf_h2_destroy()
2541 static CURLcode cf_h2_shutdown(struct Curl_cfilter *cf, in cf_h2_shutdown() argument
2544 struct cf_h2_ctx *ctx = cf->ctx; in cf_h2_shutdown()
2549 if(!cf->connected || !ctx->h2 || cf->shutdown || ctx->conn_closed) { in cf_h2_shutdown()
2554 CF_DATA_SAVE(save, cf, data); in cf_h2_shutdown()
2573 result = h2_progress_egress(cf, data); in cf_h2_shutdown()
2575 result = h2_progress_ingress(cf, data, 0); in cf_h2_shutdown()
2586 CF_DATA_RESTORE(cf, save); in cf_h2_shutdown()
2587 cf->shutdown = (result || *done); in cf_h2_shutdown()
2591 static CURLcode http2_data_pause(struct Curl_cfilter *cf, in http2_data_pause() argument
2595 struct cf_h2_ctx *ctx = cf->ctx; in http2_data_pause()
2600 CURLcode result = cf_h2_update_local_win(cf, data, stream, pause); in http2_data_pause()
2605 (void)h2_progress_egress(cf, data); in http2_data_pause()
2613 drain_stream(cf, data, stream); in http2_data_pause()
2616 CURL_TRC_CF(data, cf, "[%d] stream now %spaused", stream->id, in http2_data_pause()
2622 static CURLcode cf_h2_cntrl(struct Curl_cfilter *cf, in cf_h2_cntrl() argument
2631 CF_DATA_SAVE(save, cf, data); in cf_h2_cntrl()
2636 result = http2_data_pause(cf, data, (arg1 != 0)); in cf_h2_cntrl()
2639 result = cf_h2_flush(cf, data); in cf_h2_cntrl()
2642 http2_data_done(cf, data); in cf_h2_cntrl()
2645 http2_data_done(cf, data); in cf_h2_cntrl()
2650 CF_DATA_RESTORE(cf, save); in cf_h2_cntrl()
2654 static bool cf_h2_data_pending(struct Curl_cfilter *cf, in cf_h2_data_pending() argument
2657 struct cf_h2_ctx *ctx = cf->ctx; in cf_h2_data_pending()
2663 return cf->next ? cf->next->cft->has_data_pending(cf->next, data) : FALSE; in cf_h2_data_pending()
2666 static bool cf_h2_is_alive(struct Curl_cfilter *cf, in cf_h2_is_alive() argument
2670 struct cf_h2_ctx *ctx = cf->ctx; in cf_h2_is_alive()
2674 CF_DATA_SAVE(save, cf, data); in cf_h2_is_alive()
2675 result = (ctx && ctx->h2 && http2_connisalive(cf, data, input_pending)); in cf_h2_is_alive()
2676 CURL_TRC_CF(data, cf, "conn alive -> %d, input_pending=%d", in cf_h2_is_alive()
2678 CF_DATA_RESTORE(cf, save); in cf_h2_is_alive()
2682 static CURLcode cf_h2_keep_alive(struct Curl_cfilter *cf, in cf_h2_keep_alive() argument
2688 CF_DATA_SAVE(save, cf, data); in cf_h2_keep_alive()
2689 result = http2_send_ping(cf, data); in cf_h2_keep_alive()
2690 CF_DATA_RESTORE(cf, save); in cf_h2_keep_alive()
2694 static CURLcode cf_h2_query(struct Curl_cfilter *cf, in cf_h2_query() argument
2698 struct cf_h2_ctx *ctx = cf->ctx; in cf_h2_query()
2706 CF_DATA_SAVE(save, cf, data); in cf_h2_query()
2709 effective_max = CONN_INUSE(cf->conn); in cf_h2_query()
2715 CF_DATA_RESTORE(cf, save); in cf_h2_query()
2734 return cf->next ? in cf_h2_query()
2735 cf->next->cft->query(cf->next, data, query, pres1, pres2) : in cf_h2_query()
2764 struct Curl_cfilter *cf = NULL; in http2_cfilter_add() local
2774 result = Curl_cf_create(&cf, &Curl_cft_nghttp2, ctx); in http2_cfilter_add()
2779 Curl_conn_cf_add(data, conn, sockindex, cf); in http2_cfilter_add()
2784 *pcf = result ? NULL : cf; in http2_cfilter_add()
2788 static CURLcode http2_cfilter_insert_after(struct Curl_cfilter *cf, in http2_cfilter_insert_after() argument
2807 Curl_conn_cf_insert_after(cf, cf_h2); in http2_cfilter_insert_after()
2815 static bool cf_is_http2(struct Curl_cfilter *cf, in cf_is_http2() argument
2819 for(; cf; cf = cf->next) { in cf_is_http2()
2820 if(cf->cft == &Curl_cft_nghttp2) in cf_is_http2()
2822 if(cf->cft->flags & CF_TYPE_IP_CONNECT) in cf_is_http2()
2858 struct Curl_cfilter *cf; in Curl_http2_switch() local
2863 result = http2_cfilter_add(&cf, data, conn, sockindex, FALSE); in Curl_http2_switch()
2866 CURL_TRC_CF(data, cf, "switching connection to HTTP/2"); in Curl_http2_switch()
2872 if(cf->next) { in Curl_http2_switch()
2874 return Curl_conn_cf_connect(cf, data, FALSE, &done); in Curl_http2_switch()
2879 CURLcode Curl_http2_switch_at(struct Curl_cfilter *cf, struct Curl_easy *data) in Curl_http2_switch_at() argument
2884 DEBUGASSERT(!cf_is_http2(cf, data)); in Curl_http2_switch_at()
2886 result = http2_cfilter_insert_after(cf, data, FALSE); in Curl_http2_switch_at()
2890 cf_h2 = cf->next; in Curl_http2_switch_at()
2891 cf->conn->httpversion = 20; /* we know we are on HTTP/2 now */ in Curl_http2_switch_at()
2892 cf->conn->bits.multiplex = TRUE; /* at least potentially multiplexed */ in Curl_http2_switch_at()
2906 struct Curl_cfilter *cf; in Curl_http2_upgrade() local
2913 result = http2_cfilter_add(&cf, data, conn, sockindex, TRUE); in Curl_http2_upgrade()
2916 CURL_TRC_CF(data, cf, "upgrading connection to HTTP/2"); in Curl_http2_upgrade()
2918 DEBUGASSERT(cf->cft == &Curl_cft_nghttp2); in Curl_http2_upgrade()
2919 ctx = cf->ctx; in Curl_http2_upgrade()
2947 if(cf->next) { in Curl_http2_upgrade()
2949 return Curl_conn_cf_connect(cf, data, FALSE, &done); in Curl_http2_upgrade()