Lines Matching refs:tunnel

180   struct tunnel_stream tunnel; /* our tunnel CONNECT stream */  member
203 tunnel_stream_clear(&ctx->tunnel); in cf_h2_proxy_ctx_clear()
218 struct tunnel_stream *tunnel) in drain_tunnel() argument
225 if(!tunnel->closed && !tunnel->reset && in drain_tunnel()
226 !Curl_bufq_is_empty(&ctx->tunnel.sendbuf)) in drain_tunnel()
230 tunnel->stream_id, bits); in drain_tunnel()
335 memset(&ctx->tunnel, 0, sizeof(ctx->tunnel)); in cf_h2_proxy_ctx_init()
340 if(tunnel_stream_init(cf, &ctx->tunnel)) in cf_h2_proxy_ctx_init()
495 !ctx->tunnel.closed && /* nor the tunnel */ in proxy_h2_progress_ingress()
497 !Curl_bufq_is_full(&ctx->tunnel.recvbuf)) { in proxy_h2_progress_ingress()
696 drain_tunnel(cf, data, &ctx->tunnel); in proxy_h2_on_frame_recv()
708 if(stream_id != ctx->tunnel.stream_id) { in proxy_h2_on_frame_recv()
718 if(!ctx->tunnel.resp) in proxy_h2_on_frame_recv()
722 stream_id, ctx->tunnel.resp->status); in proxy_h2_on_frame_recv()
723 if(!ctx->tunnel.has_final_response) { in proxy_h2_on_frame_recv()
724 if(ctx->tunnel.resp->status / 100 != 1) { in proxy_h2_on_frame_recv()
725 ctx->tunnel.has_final_response = TRUE; in proxy_h2_on_frame_recv()
731 drain_tunnel(cf, data, &ctx->tunnel); in proxy_h2_on_frame_recv()
757 if(stream_id != ctx->tunnel.stream_id) { in proxy_h2_on_header()
767 if(ctx->tunnel.has_final_response) { in proxy_h2_on_header()
786 resp->prev = ctx->tunnel.resp; in proxy_h2_on_header()
787 ctx->tunnel.resp = resp; in proxy_h2_on_header()
789 stream_id, ctx->tunnel.resp->status); in proxy_h2_on_header()
793 if(!ctx->tunnel.resp) in proxy_h2_on_header()
796 result = Curl_dynhds_add(&ctx->tunnel.resp->headers, in proxy_h2_on_header()
832 DEBUGASSERT(ts == &ctx->tunnel); in tunnel_send_callback()
861 if(stream_id != ctx->tunnel.stream_id) in tunnel_recv_callback()
864 nwritten = Curl_bufq_write(&ctx->tunnel.recvbuf, mem, len, &result); in tunnel_recv_callback()
885 if(stream_id != ctx->tunnel.stream_id) in proxy_h2_on_stream_close()
890 ctx->tunnel.closed = TRUE; in proxy_h2_on_stream_close()
891 ctx->tunnel.error = error_code; in proxy_h2_on_stream_close()
1084 if((result && (result != CURLE_AGAIN)) || ctx->tunnel.closed) in H2_CONNECT()
1097 struct tunnel_stream *ts = &ctx->tunnel; in cf_h2_proxy_connect()
1221 (ctx && ctx->tunnel.state == H2_TUNNEL_ESTABLISHED && in cf_h2_proxy_data_pending()
1222 !Curl_bufq_is_empty(&ctx->tunnel.recvbuf))) in cf_h2_proxy_data_pending()
1239 !Curl_bufq_is_empty(&ctx->tunnel.sendbuf); in cf_h2_proxy_adjust_pollset()
1250 s_exhaust = ctx->tunnel.stream_id >= 0 && in cf_h2_proxy_adjust_pollset()
1252 ctx->h2, ctx->tunnel.stream_id); in cf_h2_proxy_adjust_pollset()
1257 !Curl_bufq_is_empty(&ctx->tunnel.sendbuf); in cf_h2_proxy_adjust_pollset()
1269 !Curl_bufq_is_empty(&ctx->tunnel.sendbuf); in cf_h2_proxy_adjust_pollset()
1285 if(ctx->tunnel.error == NGHTTP2_REFUSED_STREAM) { in h2_handle_tunnel_close()
1287 "connection", ctx->tunnel.stream_id); in h2_handle_tunnel_close()
1292 else if(ctx->tunnel.error != NGHTTP2_NO_ERROR) { in h2_handle_tunnel_close()
1294 ctx->tunnel.stream_id, nghttp2_http2_strerror(ctx->tunnel.error), in h2_handle_tunnel_close()
1295 ctx->tunnel.error); in h2_handle_tunnel_close()
1299 else if(ctx->tunnel.reset) { in h2_handle_tunnel_close()
1300 failf(data, "HTTP/2 stream %u was reset", ctx->tunnel.stream_id); in h2_handle_tunnel_close()
1308 ctx->tunnel.stream_id, rv, *err); in h2_handle_tunnel_close()
1319 if(!Curl_bufq_is_empty(&ctx->tunnel.recvbuf)) { in tunnel_recv()
1320 nread = Curl_bufq_read(&ctx->tunnel.recvbuf, in tunnel_recv()
1328 if(ctx->tunnel.closed) { in tunnel_recv()
1331 else if(ctx->tunnel.reset || in tunnel_recv()
1334 ctx->last_stream_id < ctx->tunnel.stream_id)) { in tunnel_recv()
1346 ctx->tunnel.stream_id, len, nread, *err); in tunnel_recv()
1359 if(ctx->tunnel.state != H2_TUNNEL_ESTABLISHED) { in cf_h2_proxy_recv()
1365 if(Curl_bufq_is_empty(&ctx->tunnel.recvbuf)) { in cf_h2_proxy_recv()
1375 ctx->tunnel.stream_id, nread); in cf_h2_proxy_recv()
1376 nghttp2_session_consume(ctx->h2, ctx->tunnel.stream_id, (size_t)nread); in cf_h2_proxy_recv()
1386 if(!Curl_bufq_is_empty(&ctx->tunnel.recvbuf) && in cf_h2_proxy_recv()
1390 drain_tunnel(cf, data, &ctx->tunnel); in cf_h2_proxy_recv()
1393 ctx->tunnel.stream_id, len, nread, *err); in cf_h2_proxy_recv()
1410 if(ctx->tunnel.state != H2_TUNNEL_ESTABLISHED) { in cf_h2_proxy_send()
1416 if(ctx->tunnel.closed) { in cf_h2_proxy_send()
1422 nwritten = Curl_bufq_write(&ctx->tunnel.sendbuf, buf, len, err); in cf_h2_proxy_send()
1427 if(!Curl_bufq_is_empty(&ctx->tunnel.sendbuf)) { in cf_h2_proxy_send()
1429 rv = nghttp2_session_resume_data(ctx->h2, ctx->tunnel.stream_id); in cf_h2_proxy_send()
1456 if(ctx->tunnel.closed) { in cf_h2_proxy_send()
1468 if(!Curl_bufq_is_empty(&ctx->tunnel.recvbuf) && in cf_h2_proxy_send()
1472 drain_tunnel(cf, data, &ctx->tunnel); in cf_h2_proxy_send()
1476 ctx->tunnel.stream_id, len, nwritten, *err, in cf_h2_proxy_send()
1478 ctx->h2, ctx->tunnel.stream_id), in cf_h2_proxy_send()
1480 Curl_bufq_len(&ctx->tunnel.sendbuf), in cf_h2_proxy_send()
1494 if(!Curl_bufq_is_empty(&ctx->tunnel.sendbuf)) { in cf_h2_proxy_flush()
1496 int rv = nghttp2_session_resume_data(ctx->h2, ctx->tunnel.stream_id); in cf_h2_proxy_flush()
1508 ctx->tunnel.stream_id, result, in cf_h2_proxy_flush()
1510 ctx->h2, ctx->tunnel.stream_id), in cf_h2_proxy_flush()
1512 Curl_bufq_len(&ctx->tunnel.sendbuf), in cf_h2_proxy_flush()
1580 !Curl_bufq_is_empty(&ctx->tunnel.sendbuf)) { in cf_h2_proxy_query()