Lines Matching refs:data

48 static void cf_cntrl_update_info(struct Curl_easy *data,
53 void Curl_cf_def_close(struct Curl_cfilter *cf, struct Curl_easy *data) in Curl_cf_def_close() argument
57 cf->next->cft->do_close(cf->next, data); in Curl_cf_def_close()
62 struct Curl_easy *data, bool *done) in Curl_cf_def_shutdown() argument
65 (void)data; in Curl_cf_def_shutdown()
70 static void conn_report_connect_stats(struct Curl_easy *data,
73 void Curl_cf_def_get_host(struct Curl_cfilter *cf, struct Curl_easy *data, in Curl_cf_def_get_host() argument
78 cf->next->cft->get_host(cf->next, data, phost, pdisplay_host, pport); in Curl_cf_def_get_host()
87 struct Curl_easy *data, in Curl_cf_def_adjust_pollset() argument
92 (void)data; in Curl_cf_def_adjust_pollset()
97 const struct Curl_easy *data) in Curl_cf_def_data_pending() argument
100 cf->next->cft->has_data_pending(cf->next, data) : FALSE; in Curl_cf_def_data_pending()
103 ssize_t Curl_cf_def_send(struct Curl_cfilter *cf, struct Curl_easy *data, in Curl_cf_def_send() argument
108 cf->next->cft->do_send(cf->next, data, buf, len, eos, err) : in Curl_cf_def_send()
112 ssize_t Curl_cf_def_recv(struct Curl_cfilter *cf, struct Curl_easy *data, in Curl_cf_def_recv() argument
116 cf->next->cft->do_recv(cf->next, data, buf, len, err) : in Curl_cf_def_recv()
121 struct Curl_easy *data, in Curl_cf_def_conn_is_alive() argument
125 cf->next->cft->is_alive(cf->next, data, input_pending) : in Curl_cf_def_conn_is_alive()
130 struct Curl_easy *data) in Curl_cf_def_conn_keep_alive() argument
133 cf->next->cft->keep_alive(cf->next, data) : in Curl_cf_def_conn_keep_alive()
138 struct Curl_easy *data, in Curl_cf_def_query() argument
142 cf->next->cft->query(cf->next, data, query, pres1, pres2) : in Curl_cf_def_query()
147 struct Curl_easy *data) in Curl_conn_cf_discard_chain() argument
159 cf->cft->destroy(cf, data); in Curl_conn_cf_discard_chain()
166 void Curl_conn_cf_discard_all(struct Curl_easy *data, in Curl_conn_cf_discard_all() argument
169 Curl_conn_cf_discard_chain(&conn->cfilter[index], data); in Curl_conn_cf_discard_all()
172 void Curl_conn_close(struct Curl_easy *data, int index) in Curl_conn_close() argument
176 DEBUGASSERT(data->conn); in Curl_conn_close()
178 cf = data->conn->cfilter[index]; in Curl_conn_close()
180 cf->cft->do_close(cf, data); in Curl_conn_close()
182 Curl_shutdown_clear(data, index); in Curl_conn_close()
185 CURLcode Curl_conn_shutdown(struct Curl_easy *data, int sockindex, bool *done) in Curl_conn_shutdown() argument
192 DEBUGASSERT(data->conn); in Curl_conn_shutdown()
194 cf = data->conn->cfilter[sockindex]; in Curl_conn_shutdown()
205 if(!Curl_shutdown_started(data, sockindex)) { in Curl_conn_shutdown()
206 DEBUGF(infof(data, "shutdown start on%s connection", in Curl_conn_shutdown()
208 Curl_shutdown_start(data, sockindex, &now); in Curl_conn_shutdown()
211 timeout_ms = Curl_shutdown_timeleft(data->conn, sockindex, &now); in Curl_conn_shutdown()
214 infof(data, "shutdown timeout"); in Curl_conn_shutdown()
222 result = cf->cft->do_shutdown(cf, data, &cfdone); in Curl_conn_shutdown()
224 CURL_TRC_CF(data, cf, "shut down failed with %d", result); in Curl_conn_shutdown()
228 CURL_TRC_CF(data, cf, "shut down not done yet"); in Curl_conn_shutdown()
231 CURL_TRC_CF(data, cf, "shut down successfully"); in Curl_conn_shutdown()
240 ssize_t Curl_cf_recv(struct Curl_easy *data, int num, char *buf, in Curl_cf_recv() argument
245 DEBUGASSERT(data); in Curl_cf_recv()
246 DEBUGASSERT(data->conn); in Curl_cf_recv()
248 cf = data->conn->cfilter[num]; in Curl_cf_recv()
253 ssize_t nread = cf->cft->do_recv(cf, data, buf, len, code); in Curl_cf_recv()
258 failf(data, "recv: no filter connected"); in Curl_cf_recv()
263 ssize_t Curl_cf_send(struct Curl_easy *data, int num, in Curl_cf_send() argument
269 DEBUGASSERT(data); in Curl_cf_send()
270 DEBUGASSERT(data->conn); in Curl_cf_send()
272 cf = data->conn->cfilter[num]; in Curl_cf_send()
277 ssize_t nwritten = cf->cft->do_send(cf, data, mem, len, eos, code); in Curl_cf_send()
282 failf(data, "send: no filter connected"); in Curl_cf_send()
308 void Curl_conn_cf_add(struct Curl_easy *data, in Curl_conn_cf_add() argument
313 (void)data; in Curl_conn_cf_add()
322 CURL_TRC_CF(data, cf, "added"); in Curl_conn_cf_add()
347 struct Curl_easy *data, in Curl_conn_cf_discard_sub() argument
366 discard->cft->destroy(discard, data); in Curl_conn_cf_discard_sub()
373 struct Curl_easy *data, in Curl_conn_cf_connect() argument
377 return cf->cft->do_connect(cf, data, blocking, done); in Curl_conn_cf_connect()
381 void Curl_conn_cf_close(struct Curl_cfilter *cf, struct Curl_easy *data) in Curl_conn_cf_close() argument
384 cf->cft->do_close(cf, data); in Curl_conn_cf_close()
387 ssize_t Curl_conn_cf_send(struct Curl_cfilter *cf, struct Curl_easy *data, in Curl_conn_cf_send() argument
392 return cf->cft->do_send(cf, data, buf, len, eos, err); in Curl_conn_cf_send()
397 ssize_t Curl_conn_cf_recv(struct Curl_cfilter *cf, struct Curl_easy *data, in Curl_conn_cf_recv() argument
401 return cf->cft->do_recv(cf, data, buf, len, err); in Curl_conn_cf_recv()
406 CURLcode Curl_conn_connect(struct Curl_easy *data, in Curl_conn_connect() argument
414 DEBUGASSERT(data); in Curl_conn_connect()
415 DEBUGASSERT(data->conn); in Curl_conn_connect()
417 cf = data->conn->cfilter[sockindex]; in Curl_conn_connect()
426 if(Curl_conn_needs_flush(data, sockindex)) { in Curl_conn_connect()
427 DEBUGF(infof(data, "Curl_conn_connect(index=%d), flush", sockindex)); in Curl_conn_connect()
428 result = Curl_conn_flush(data, sockindex); in Curl_conn_connect()
433 result = cf->cft->do_connect(cf, data, blocking, done); in Curl_conn_connect()
438 cf_cntrl_update_info(data, data->conn); in Curl_conn_connect()
439 conn_report_connect_stats(data, data->conn); in Curl_conn_connect()
440 data->conn->keepalive = Curl_now(); in Curl_conn_connect()
441 Curl_verboseconnect(data, data->conn, sockindex); in Curl_conn_connect()
444 conn_report_connect_stats(data, data->conn); in Curl_conn_connect()
459 bool Curl_conn_is_ip_connected(struct Curl_easy *data, int sockindex) in Curl_conn_is_ip_connected() argument
463 cf = data->conn->cfilter[sockindex]; in Curl_conn_is_ip_connected()
504 bool Curl_conn_data_pending(struct Curl_easy *data, int sockindex) in Curl_conn_data_pending() argument
508 (void)data; in Curl_conn_data_pending()
509 DEBUGASSERT(data); in Curl_conn_data_pending()
510 DEBUGASSERT(data->conn); in Curl_conn_data_pending()
512 cf = data->conn->cfilter[sockindex]; in Curl_conn_data_pending()
517 return cf->cft->has_data_pending(cf, data); in Curl_conn_data_pending()
523 struct Curl_easy *data) in Curl_conn_cf_needs_flush() argument
527 result = cf ? cf->cft->query(cf, data, CF_QUERY_NEED_FLUSH, in Curl_conn_cf_needs_flush()
532 bool Curl_conn_needs_flush(struct Curl_easy *data, int sockindex) in Curl_conn_needs_flush() argument
534 return Curl_conn_cf_needs_flush(data->conn->cfilter[sockindex], data); in Curl_conn_needs_flush()
538 struct Curl_easy *data, in Curl_conn_cf_adjust_pollset() argument
550 cf->cft->adjust_pollset(cf, data, ps); in Curl_conn_cf_adjust_pollset()
555 void Curl_conn_adjust_pollset(struct Curl_easy *data, in Curl_conn_adjust_pollset() argument
560 DEBUGASSERT(data); in Curl_conn_adjust_pollset()
561 DEBUGASSERT(data->conn); in Curl_conn_adjust_pollset()
563 Curl_conn_cf_adjust_pollset(data->conn->cfilter[i], data, ps); in Curl_conn_adjust_pollset()
568 struct Curl_easy *data, in Curl_conn_cf_poll() argument
576 DEBUGASSERT(data); in Curl_conn_cf_poll()
577 DEBUGASSERT(data->conn); in Curl_conn_cf_poll()
581 Curl_conn_cf_adjust_pollset(cf, data, &ps); in Curl_conn_cf_poll()
599 DEBUGF(infof(data, "no sockets to poll!")); in Curl_conn_cf_poll()
603 void Curl_conn_get_host(struct Curl_easy *data, int sockindex, in Curl_conn_get_host() argument
609 DEBUGASSERT(data->conn); in Curl_conn_get_host()
610 cf = data->conn->cfilter[sockindex]; in Curl_conn_get_host()
612 cf->cft->get_host(cf, data, phost, pdisplay_host, pport); in Curl_conn_get_host()
619 *phost = data->conn->host.name; in Curl_conn_get_host()
620 *pdisplay_host = data->conn->host.dispname; in Curl_conn_get_host()
621 *pport = data->conn->remote_port; in Curl_conn_get_host()
626 struct Curl_easy *data, in Curl_cf_def_cntrl() argument
630 (void)data; in Curl_cf_def_cntrl()
638 struct Curl_easy *data, in Curl_conn_cf_cntrl() argument
647 result = cf->cft->cntrl(cf, data, event, arg1, arg2); in Curl_conn_cf_cntrl()
655 struct Curl_easy *data) in Curl_conn_cf_get_socket() argument
658 if(cf && !cf->cft->query(cf, data, CF_QUERY_SOCKET, NULL, &sock)) in Curl_conn_cf_get_socket()
664 struct Curl_easy *data, in Curl_conn_cf_get_ip_info() argument
668 return cf->cft->query(cf, data, CF_QUERY_IP_INFO, is_ipv6, ipquad); in Curl_conn_cf_get_ip_info()
672 curl_socket_t Curl_conn_get_socket(struct Curl_easy *data, int sockindex) in Curl_conn_get_socket() argument
676 cf = data->conn ? data->conn->cfilter[sockindex] : NULL; in Curl_conn_get_socket()
681 return Curl_conn_cf_get_socket(cf, data); in Curl_conn_get_socket()
682 return data->conn ? data->conn->sock[sockindex] : CURL_SOCKET_BAD; in Curl_conn_get_socket()
685 void Curl_conn_forget_socket(struct Curl_easy *data, int sockindex) in Curl_conn_forget_socket() argument
687 if(data->conn) { in Curl_conn_forget_socket()
688 struct Curl_cfilter *cf = data->conn->cfilter[sockindex]; in Curl_conn_forget_socket()
690 (void)Curl_conn_cf_cntrl(cf, data, TRUE, in Curl_conn_forget_socket()
692 fake_sclose(data->conn->sock[sockindex]); in Curl_conn_forget_socket()
693 data->conn->sock[sockindex] = CURL_SOCKET_BAD; in Curl_conn_forget_socket()
698 struct Curl_easy *data, in cf_cntrl_all() argument
706 result = Curl_conn_cf_cntrl(conn->cfilter[i], data, ignore_result, in cf_cntrl_all()
715 struct Curl_easy *data) in Curl_conn_ev_data_attach() argument
717 cf_cntrl_all(conn, data, TRUE, CF_CTRL_DATA_ATTACH, 0, NULL); in Curl_conn_ev_data_attach()
721 struct Curl_easy *data) in Curl_conn_ev_data_detach() argument
723 cf_cntrl_all(conn, data, TRUE, CF_CTRL_DATA_DETACH, 0, NULL); in Curl_conn_ev_data_detach()
726 CURLcode Curl_conn_ev_data_setup(struct Curl_easy *data) in Curl_conn_ev_data_setup() argument
728 return cf_cntrl_all(data->conn, data, FALSE, in Curl_conn_ev_data_setup()
732 CURLcode Curl_conn_ev_data_idle(struct Curl_easy *data) in Curl_conn_ev_data_idle() argument
734 return cf_cntrl_all(data->conn, data, FALSE, in Curl_conn_ev_data_idle()
739 CURLcode Curl_conn_flush(struct Curl_easy *data, int sockindex) in Curl_conn_flush() argument
741 return Curl_conn_cf_cntrl(data->conn->cfilter[sockindex], data, FALSE, in Curl_conn_flush()
749 void Curl_conn_ev_data_done_send(struct Curl_easy *data) in Curl_conn_ev_data_done_send() argument
751 cf_cntrl_all(data->conn, data, TRUE, CF_CTRL_DATA_DONE_SEND, 0, NULL); in Curl_conn_ev_data_done_send()
758 void Curl_conn_ev_data_done(struct Curl_easy *data, bool premature) in Curl_conn_ev_data_done() argument
760 cf_cntrl_all(data->conn, data, TRUE, CF_CTRL_DATA_DONE, premature, NULL); in Curl_conn_ev_data_done()
763 CURLcode Curl_conn_ev_data_pause(struct Curl_easy *data, bool do_pause) in Curl_conn_ev_data_pause() argument
765 return cf_cntrl_all(data->conn, data, FALSE, in Curl_conn_ev_data_pause()
769 static void cf_cntrl_update_info(struct Curl_easy *data, in cf_cntrl_update_info() argument
772 cf_cntrl_all(conn, data, TRUE, CF_CTRL_CONN_INFO_UPDATE, 0, NULL); in cf_cntrl_update_info()
778 static void conn_report_connect_stats(struct Curl_easy *data, in conn_report_connect_stats() argument
787 cf->cft->query(cf, data, CF_QUERY_TIMER_CONNECT, NULL, &connected); in conn_report_connect_stats()
789 Curl_pgrsTimeWas(data, TIMER_CONNECT, connected); in conn_report_connect_stats()
792 cf->cft->query(cf, data, CF_QUERY_TIMER_APPCONNECT, NULL, &appconnected); in conn_report_connect_stats()
794 Curl_pgrsTimeWas(data, TIMER_APPCONNECT, appconnected); in conn_report_connect_stats()
798 bool Curl_conn_is_alive(struct Curl_easy *data, struct connectdata *conn, in Curl_conn_is_alive() argument
803 cf->cft->is_alive(cf, data, input_pending); in Curl_conn_is_alive()
806 CURLcode Curl_conn_keep_alive(struct Curl_easy *data, in Curl_conn_keep_alive() argument
811 return cf ? cf->cft->keep_alive(cf, data) : CURLE_OK; in Curl_conn_keep_alive()
814 size_t Curl_conn_get_max_concurrent(struct Curl_easy *data, in Curl_conn_get_max_concurrent() argument
822 result = cf ? cf->cft->query(cf, data, CF_QUERY_MAX_CONCURRENT, in Curl_conn_get_max_concurrent()
827 int Curl_conn_get_stream_error(struct Curl_easy *data, in Curl_conn_get_stream_error() argument
835 result = cf ? cf->cft->query(cf, data, CF_QUERY_STREAM_ERROR, in Curl_conn_get_stream_error()
840 int Curl_conn_sockindex(struct Curl_easy *data, curl_socket_t sockfd) in Curl_conn_sockindex() argument
842 if(data && data->conn && in Curl_conn_sockindex()
843 sockfd != CURL_SOCKET_BAD && sockfd == data->conn->sock[SECONDARYSOCKET]) in Curl_conn_sockindex()
848 CURLcode Curl_conn_recv(struct Curl_easy *data, int sockindex, in Curl_conn_recv() argument
854 DEBUGASSERT(data->conn); in Curl_conn_recv()
855 nread = data->conn->recv[sockindex](data, sockindex, buf, blen, &result); in Curl_conn_recv()
862 CURLcode Curl_conn_send(struct Curl_easy *data, int sockindex, in Curl_conn_send() argument
873 DEBUGASSERT(data); in Curl_conn_send()
874 DEBUGASSERT(data->conn); in Curl_conn_send()
875 conn = data->conn; in Curl_conn_send()
890 nwritten = conn->send[sockindex](data, sockindex, buf, write_len, eos, in Curl_conn_send()
897 void Curl_pollset_reset(struct Curl_easy *data, in Curl_pollset_reset() argument
901 (void)data; in Curl_pollset_reset()
910 void Curl_pollset_change(struct Curl_easy *data, in Curl_pollset_change() argument
916 (void)data; in Curl_pollset_change()
960 void Curl_pollset_set(struct Curl_easy *data, in Curl_pollset_set() argument
964 Curl_pollset_change(data, ps, sock, in Curl_pollset_set()
971 static void ps_add(struct Curl_easy *data, struct easy_pollset *ps, in ps_add() argument
982 Curl_pollset_add_inout(data, ps, socks[i]); in ps_add()
985 Curl_pollset_add_in(data, ps, socks[i]); in ps_add()
988 Curl_pollset_add_out(data, ps, socks[i]); in ps_add()
993 void Curl_pollset_add_socks(struct Curl_easy *data, in Curl_pollset_add_socks() argument
995 int (*get_socks_cb)(struct Curl_easy *data, in Curl_pollset_add_socks() argument
1001 bitmap = get_socks_cb(data, socks); in Curl_pollset_add_socks()
1002 ps_add(data, ps, bitmap, socks); in Curl_pollset_add_socks()
1005 void Curl_pollset_check(struct Curl_easy *data, in Curl_pollset_check() argument
1011 (void)data; in Curl_pollset_check()