Lines Matching refs:httpc
81 struct http_conn *httpc,
109 const struct http_conn *c = &conn->proto.httpc; in http2_perform_getsock()
162 struct http_conn *c = &conn->proto.httpc; in http2_disconnect()
207 struct http_conn *httpc = &conn->proto.httpc; in http2_connisdead() local
209 if(httpc->recv_underlying) in http2_connisdead()
211 nread = ((Curl_recv *)httpc->recv_underlying)( in http2_connisdead()
212 conn, FIRSTSOCKET, httpc->inbuf, H2_BUFSIZE, &result); in http2_connisdead()
217 httpc->nread_inbuf = 0; in http2_connisdead()
218 httpc->inbuflen = nread; in http2_connisdead()
219 (void)h2_process_pending_input(conn, httpc, &result); in http2_connisdead()
234 struct http_conn *c = &check->proto.httpc; in http2_conncheck()
294 conn->proto.httpc.settings.max_concurrent_streams = in Curl_http2_setup_conn()
296 conn->proto.httpc.error_code = NGHTTP2_NO_ERROR; in Curl_http2_setup_conn()
395 struct http_conn *c = &conn->proto.httpc; in send_callback()
483 struct http_conn *httpc) in drained_transfer() argument
485 DEBUGASSERT(httpc->drain_total >= data->state.drain); in drained_transfer()
486 httpc->drain_total -= data->state.drain; in drained_transfer()
494 struct http_conn *httpc) in drain_this() argument
497 httpc->drain_total++; in drain_this()
498 DEBUGASSERT(httpc->drain_total >= data->state.drain); in drain_this()
541 struct http_conn *httpc; in push_promise() local
602 httpc = &conn->proto.httpc; in push_promise()
603 rv = nghttp2_session_set_stream_user_data(httpc->h2, in push_promise()
637 struct http_conn *httpc = &conn->proto.httpc; in on_frame_recv() local
648 uint32_t max_conn = httpc->settings.max_concurrent_streams; in on_frame_recv()
650 httpc->settings.max_concurrent_streams = in on_frame_recv()
653 httpc->settings.enable_push = in on_frame_recv()
657 httpc->settings.max_concurrent_streams)); in on_frame_recv()
659 httpc->settings.enable_push?"TRUE":"false")); in on_frame_recv()
660 if(max_conn != httpc->settings.max_concurrent_streams) { in on_frame_recv()
664 httpc->settings.max_concurrent_streams); in on_frame_recv()
737 drain_this(data_s, httpc); in on_frame_recv()
797 drain_this(data_s, &conn->proto.httpc); in on_data_chunk_recv()
815 data_s->conn->proto.httpc.pause_stream_id = stream_id; in on_data_chunk_recv()
823 data_s->conn->proto.httpc.pause_stream_id = stream_id; in on_data_chunk_recv()
842 struct http_conn *httpc; in on_stream_close() local
858 httpc = &conn->proto.httpc; in on_stream_close()
859 drain_this(data_s, httpc); in on_stream_close()
860 httpc->error_code = error_code; in on_stream_close()
869 if(stream_id == httpc->pause_stream_id) { in on_stream_close()
871 httpc->pause_stream_id = 0; in on_stream_close()
1164 struct http_conn *httpc) in populate_settings() argument
1166 nghttp2_settings_entry *iv = httpc->local_settings; in populate_settings()
1177 httpc->local_settings_num = 3; in populate_settings()
1184 struct http_conn *httpc = &conn->proto.httpc; in Curl_http2_done() local
1201 if(!httpc->h2) /* not HTTP/2 ? */ in Curl_http2_done()
1205 drained_transfer(data, httpc); in Curl_http2_done()
1209 if(!nghttp2_submit_rst_stream(httpc->h2, NGHTTP2_FLAG_NONE, in Curl_http2_done()
1211 (void)nghttp2_session_send(httpc->h2); in Curl_http2_done()
1213 if(http->stream_id == httpc->pause_stream_id) { in Curl_http2_done()
1215 httpc->pause_stream_id = 0; in Curl_http2_done()
1220 int rv = nghttp2_session_set_stream_user_data(httpc->h2, in Curl_http2_done()
1236 if(!conn->proto.httpc.h2) { in http2_init()
1240 conn->proto.httpc.inbuf = malloc(H2_BUFSIZE); in http2_init()
1241 if(conn->proto.httpc.inbuf == NULL) in http2_init()
1273 rc = nghttp2_session_client_new(&conn->proto.httpc.h2, callbacks, conn); in http2_init()
1296 uint8_t *binsettings = conn->proto.httpc.binsettings; in Curl_http2_request_upgrade()
1297 struct http_conn *httpc = &conn->proto.httpc; in Curl_http2_request_upgrade() local
1299 populate_settings(conn, httpc); in Curl_http2_request_upgrade()
1303 httpc->local_settings, in Curl_http2_request_upgrade()
1304 httpc->local_settings_num); in Curl_http2_request_upgrade()
1310 conn->proto.httpc.binlen = binlen; in Curl_http2_request_upgrade()
1334 static int should_close_session(struct http_conn *httpc) in should_close_session() argument
1336 return httpc->drain_total == 0 && !nghttp2_session_want_read(httpc->h2) && in should_close_session()
1337 !nghttp2_session_want_write(httpc->h2); in should_close_session()
1347 struct http_conn *httpc, in h2_process_pending_input() argument
1355 nread = httpc->inbuflen - httpc->nread_inbuf; in h2_process_pending_input()
1356 inbuf = httpc->inbuf + httpc->nread_inbuf; in h2_process_pending_input()
1358 rv = nghttp2_session_mem_recv(httpc->h2, (const uint8_t *)inbuf, nread); in h2_process_pending_input()
1371 httpc->inbuflen = 0; in h2_process_pending_input()
1372 httpc->nread_inbuf = 0; in h2_process_pending_input()
1375 httpc->nread_inbuf += rv; in h2_process_pending_input()
1379 httpc->inbuflen - httpc->nread_inbuf)); in h2_process_pending_input()
1382 rv = h2_session_send(data, httpc->h2); in h2_process_pending_input()
1388 if(should_close_session(httpc)) { in h2_process_pending_input()
1391 if(httpc->error_code) in h2_process_pending_input()
1419 struct http_conn *httpc = &conn->proto.httpc; in Curl_http2_done_sending() local
1420 nghttp2_session *h2 = httpc->h2; in Curl_http2_done_sending()
1428 (void)h2_process_pending_input(conn, httpc, &result); in Curl_http2_done_sending()
1440 struct http_conn *httpc = &conn->proto.httpc; in http2_handle_stream_close() local
1442 if(httpc->pause_stream_id == stream->stream_id) { in http2_handle_stream_close()
1443 httpc->pause_stream_id = 0; in http2_handle_stream_close()
1446 drained_transfer(data, httpc); in http2_handle_stream_close()
1448 if(httpc->pause_stream_id == 0) { in http2_handle_stream_close()
1449 if(h2_process_pending_input(conn, httpc, err) != 0) { in http2_handle_stream_close()
1458 if(httpc->error_code == NGHTTP2_REFUSED_STREAM) { in http2_handle_stream_close()
1466 else if(httpc->error_code != NGHTTP2_NO_ERROR) { in http2_handle_stream_close()
1468 stream->stream_id, http2_strerror(httpc->error_code), in http2_handle_stream_close()
1469 httpc->error_code); in http2_handle_stream_close()
1561 struct http_conn *httpc = &conn->proto.httpc; in http2_recv() local
1567 if(should_close_session(httpc)) { in http2_recv()
1613 if(httpc->pause_stream_id == stream->stream_id && !stream->pausedata) { in http2_recv()
1616 httpc->pause_stream_id = 0; in http2_recv()
1617 if(h2_process_pending_input(conn, httpc, &result) != 0) { in http2_recv()
1624 DEBUGASSERT(httpc->pause_stream_id == stream->stream_id); in http2_recv()
1634 DEBUGASSERT(httpc->pause_stream_id == stream->stream_id); in http2_recv()
1635 httpc->pause_stream_id = 0; in http2_recv()
1647 if(h2_process_pending_input(conn, httpc, &result) != 0) { in http2_recv()
1656 else if(httpc->pause_stream_id) { in http2_recv()
1666 stream->stream_id, httpc->pause_stream_id)); in http2_recv()
1678 if(httpc->inbuflen == 0) { in http2_recv()
1679 nread = ((Curl_recv *)httpc->recv_underlying)( in http2_recv()
1680 conn, FIRSTSOCKET, httpc->inbuf, H2_BUFSIZE, &result); in http2_recv()
1701 httpc->inbuflen = nread; in http2_recv()
1702 inbuf = httpc->inbuf; in http2_recv()
1705 nread = httpc->inbuflen - httpc->nread_inbuf; in http2_recv()
1706 inbuf = httpc->inbuf + httpc->nread_inbuf; in http2_recv()
1711 rv = nghttp2_session_mem_recv(httpc->h2, (const uint8_t *)inbuf, nread); in http2_recv()
1722 httpc->inbuflen = 0; in http2_recv()
1723 httpc->nread_inbuf = 0; in http2_recv()
1726 httpc->nread_inbuf += rv; in http2_recv()
1728 httpc->inbuflen - httpc->nread_inbuf)); in http2_recv()
1732 rv = h2_session_send(data, httpc->h2); in http2_recv()
1738 if(should_close_session(httpc)) { in http2_recv()
1750 if(httpc->pause_stream_id == stream->stream_id) { in http2_recv()
1757 drained_transfer(data, httpc); in http2_recv()
1855 struct http_conn *httpc = &conn->proto.httpc; in http2_send() local
1865 nghttp2_session *h2 = httpc->h2; in http2_send()
1898 if(should_close_session(httpc)) { in http2_send()
2129 if(should_close_session(httpc)) { in http2_send()
2158 struct http_conn *httpc = &conn->proto.httpc; in Curl_http2_setup() local
2189 httpc->inbuflen = 0; in Curl_http2_setup()
2190 httpc->nread_inbuf = 0; in Curl_http2_setup()
2192 httpc->pause_stream_id = 0; in Curl_http2_setup()
2193 httpc->drain_total = 0; in Curl_http2_setup()
2209 struct http_conn *httpc = &conn->proto.httpc; in Curl_http2_switched() local
2219 httpc->recv_underlying = conn->recv[FIRSTSOCKET]; in Curl_http2_switched()
2220 httpc->send_underlying = conn->send[FIRSTSOCKET]; in Curl_http2_switched()
2228 rv = nghttp2_session_upgrade(httpc->h2, httpc->binsettings, in Curl_http2_switched()
2229 httpc->binlen, NULL); in Curl_http2_switched()
2236 rv = nghttp2_session_set_stream_user_data(httpc->h2, in Curl_http2_switched()
2246 populate_settings(conn, httpc); in Curl_http2_switched()
2250 rv = nghttp2_submit_settings(httpc->h2, NGHTTP2_FLAG_NONE, in Curl_http2_switched()
2251 httpc->local_settings, in Curl_http2_switched()
2252 httpc->local_settings_num); in Curl_http2_switched()
2261 rv = nghttp2_session_set_local_window_size(httpc->h2, NGHTTP2_FLAG_NONE, 0, in Curl_http2_switched()
2286 memcpy(httpc->inbuf, mem, nread); in Curl_http2_switched()
2287 httpc->inbuflen = nread; in Curl_http2_switched()
2289 nproc = nghttp2_session_mem_recv(httpc->h2, (const uint8_t *)httpc->inbuf, in Curl_http2_switched()
2290 httpc->inbuflen); in Curl_http2_switched()
2301 httpc->inbuflen = 0; in Curl_http2_switched()
2302 httpc->nread_inbuf = 0; in Curl_http2_switched()
2305 httpc->nread_inbuf += nproc; in Curl_http2_switched()
2309 rv = h2_session_send(data, httpc->h2); in Curl_http2_switched()
2317 if(should_close_session(httpc)) { in Curl_http2_switched()
2412 struct http_conn *httpc = &conn->proto.httpc; in Curl_h2_http_1_1_error() local
2413 return (httpc->error_code == NGHTTP2_HTTP_1_1_REQUIRED); in Curl_h2_http_1_1_error()