Lines Matching defs:tunnel

61     H2_TUNNEL_INIT,     /* init/default/no tunnel state */
138 CURL_TRC_CF(data, cf, "[%d] new tunnel state 'init'", ts->stream_id);
143 CURL_TRC_CF(data, cf, "[%d] new tunnel state 'connect'", ts->stream_id);
148 CURL_TRC_CF(data, cf, "[%d] new tunnel state 'response'", ts->stream_id);
153 CURL_TRC_CF(data, cf, "[%d] new tunnel state 'established'",
161 CURL_TRC_CF(data, cf, "[%d] new tunnel state 'failed'", ts->stream_id);
179 struct tunnel_stream tunnel; /* our tunnel CONNECT stream */
201 tunnel_stream_clear(&ctx->tunnel);
216 struct tunnel_stream *tunnel)
222 if(!tunnel->closed && !tunnel->reset && tunnel->upload_blocked_len)
226 tunnel->stream_id, bits);
329 memset(&ctx->tunnel, 0, sizeof(ctx->tunnel));
334 if(tunnel_stream_init(cf, &ctx->tunnel))
489 !ctx->tunnel.closed && /* nor the tunnel */
491 !Curl_bufq_is_full(&ctx->tunnel.recvbuf)) {
692 drain_tunnel(cf, data, &ctx->tunnel);
704 if(stream_id != ctx->tunnel.stream_id) {
705 CURL_TRC_CF(data, cf, "[%d] rcvd FRAME not for tunnel", stream_id);
714 if(!ctx->tunnel.resp)
718 stream_id, ctx->tunnel.resp->status);
719 if(!ctx->tunnel.has_final_response) {
720 if(ctx->tunnel.resp->status / 100 != 1) {
721 ctx->tunnel.has_final_response = TRUE;
727 drain_tunnel(cf, data, &ctx->tunnel);
753 if(stream_id != ctx->tunnel.stream_id) {
754 CURL_TRC_CF(data, cf, "[%d] header for non-tunnel stream: "
763 if(ctx->tunnel.has_final_response) {
764 /* we do not do anything with trailers for tunnel streams */
782 resp->prev = ctx->tunnel.resp;
783 ctx->tunnel.resp = resp;
785 stream_id, ctx->tunnel.resp->status);
789 if(!ctx->tunnel.resp)
792 result = Curl_dynhds_add(&ctx->tunnel.resp->headers,
828 DEBUGASSERT(ts == &ctx->tunnel);
857 if(stream_id != ctx->tunnel.stream_id)
860 nwritten = Curl_bufq_write(&ctx->tunnel.recvbuf, mem, len, &result);
881 if(stream_id != ctx->tunnel.stream_id)
886 ctx->tunnel.closed = TRUE;
887 ctx->tunnel.error = error_code;
960 infof(data, "Establish HTTP/2 proxy tunnel to %s", req->authority);
987 infof(data, "CONNECT tunnel established, response %d", ts->resp->status);
1077 if(result || ctx->tunnel.closed)
1090 struct tunnel_stream *ts = &ctx->tunnel;
1165 (ctx && ctx->tunnel.state == H2_TUNNEL_ESTABLISHED &&
1166 !Curl_bufq_is_empty(&ctx->tunnel.recvbuf)))
1186 s_exhaust = ctx->tunnel.stream_id >= 0 &&
1188 ctx->h2, ctx->tunnel.stream_id);
1205 if(ctx->tunnel.error == NGHTTP2_REFUSED_STREAM) {
1207 "connection", ctx->tunnel.stream_id);
1212 else if(ctx->tunnel.error != NGHTTP2_NO_ERROR) {
1214 ctx->tunnel.stream_id, nghttp2_http2_strerror(ctx->tunnel.error),
1215 ctx->tunnel.error);
1219 else if(ctx->tunnel.reset) {
1220 failf(data, "HTTP/2 stream %u was reset", ctx->tunnel.stream_id);
1228 ctx->tunnel.stream_id, rv, *err);
1239 if(!Curl_bufq_is_empty(&ctx->tunnel.recvbuf)) {
1240 nread = Curl_bufq_read(&ctx->tunnel.recvbuf,
1248 if(ctx->tunnel.closed) {
1251 else if(ctx->tunnel.reset ||
1253 (ctx->goaway && ctx->last_stream_id < ctx->tunnel.stream_id)) {
1265 ctx->tunnel.stream_id, len, nread, *err);
1278 if(ctx->tunnel.state != H2_TUNNEL_ESTABLISHED) {
1284 if(Curl_bufq_is_empty(&ctx->tunnel.recvbuf)) {
1294 ctx->tunnel.stream_id, nread);
1295 nghttp2_session_consume(ctx->h2, ctx->tunnel.stream_id, (size_t)nread);
1305 ctx->tunnel.stream_id);
1306 drain_tunnel(cf, data, &ctx->tunnel);
1314 if(!Curl_bufq_is_empty(&ctx->tunnel.recvbuf) &&
1318 drain_tunnel(cf, data, &ctx->tunnel);
1321 ctx->tunnel.stream_id, len, nread, *err);
1337 if(ctx->tunnel.state != H2_TUNNEL_ESTABLISHED) {
1343 if(ctx->tunnel.closed) {
1348 else if(ctx->tunnel.upload_blocked_len) {
1351 DEBUGASSERT(len >= ctx->tunnel.upload_blocked_len);
1352 if(len < ctx->tunnel.upload_blocked_len) {
1360 nwritten = (ssize_t)ctx->tunnel.upload_blocked_len;
1361 ctx->tunnel.upload_blocked_len = 0;
1365 nwritten = Curl_bufq_write(&ctx->tunnel.sendbuf, buf, len, err);
1373 if(!Curl_bufq_is_empty(&ctx->tunnel.sendbuf)) {
1375 rv = nghttp2_session_resume_data(ctx->h2, ctx->tunnel.stream_id);
1401 else if(!Curl_bufq_is_empty(&ctx->tunnel.sendbuf)) {
1413 ctx->h2, ctx->tunnel.stream_id);
1421 "window is exhausted", ctx->tunnel.stream_id);
1427 ctx->tunnel.upload_blocked_len = nwritten;
1430 ctx->tunnel.stream_id, len,
1433 drain_tunnel(cf, data, &ctx->tunnel);
1441 if(ctx->tunnel.closed) {
1453 if(!Curl_bufq_is_empty(&ctx->tunnel.recvbuf) &&
1457 drain_tunnel(cf, data, &ctx->tunnel);
1461 ctx->tunnel.stream_id, len, nwritten, *err,
1463 ctx->h2, ctx->tunnel.stream_id),
1465 Curl_bufq_len(&ctx->tunnel.sendbuf),