Lines Matching refs:cf
53 void Curl_cf_def_close(struct Curl_cfilter *cf, struct Curl_easy *data) in Curl_cf_def_close() argument
55 cf->connected = FALSE; in Curl_cf_def_close()
56 if(cf->next) in Curl_cf_def_close()
57 cf->next->cft->do_close(cf->next, data); in Curl_cf_def_close()
61 CURLcode Curl_cf_def_shutdown(struct Curl_cfilter *cf, in Curl_cf_def_shutdown() argument
64 (void)cf; in Curl_cf_def_shutdown()
73 void Curl_cf_def_get_host(struct Curl_cfilter *cf, struct Curl_easy *data, in Curl_cf_def_get_host() argument
77 if(cf->next) in Curl_cf_def_get_host()
78 cf->next->cft->get_host(cf->next, data, phost, pdisplay_host, pport); in Curl_cf_def_get_host()
80 *phost = cf->conn->host.name; in Curl_cf_def_get_host()
81 *pdisplay_host = cf->conn->host.dispname; in Curl_cf_def_get_host()
82 *pport = cf->conn->primary.remote_port; in Curl_cf_def_get_host()
86 void Curl_cf_def_adjust_pollset(struct Curl_cfilter *cf, in Curl_cf_def_adjust_pollset() argument
91 (void)cf; in Curl_cf_def_adjust_pollset()
96 bool Curl_cf_def_data_pending(struct Curl_cfilter *cf, in Curl_cf_def_data_pending() argument
99 return cf->next ? in Curl_cf_def_data_pending()
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
107 return cf->next ? in Curl_cf_def_send()
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
115 return cf->next ? in Curl_cf_def_recv()
116 cf->next->cft->do_recv(cf->next, data, buf, len, err) : in Curl_cf_def_recv()
120 bool Curl_cf_def_conn_is_alive(struct Curl_cfilter *cf, in Curl_cf_def_conn_is_alive() argument
124 return cf->next ? in Curl_cf_def_conn_is_alive()
125 cf->next->cft->is_alive(cf->next, data, input_pending) : in Curl_cf_def_conn_is_alive()
129 CURLcode Curl_cf_def_conn_keep_alive(struct Curl_cfilter *cf, in Curl_cf_def_conn_keep_alive() argument
132 return cf->next ? in Curl_cf_def_conn_keep_alive()
133 cf->next->cft->keep_alive(cf->next, data) : in Curl_cf_def_conn_keep_alive()
137 CURLcode Curl_cf_def_query(struct Curl_cfilter *cf, in Curl_cf_def_query() argument
141 return cf->next ? in Curl_cf_def_query()
142 cf->next->cft->query(cf->next, data, query, pres1, pres2) : in Curl_cf_def_query()
149 struct Curl_cfilter *cfn, *cf = *pcf; in Curl_conn_cf_discard_chain() local
151 if(cf) { in Curl_conn_cf_discard_chain()
153 while(cf) { in Curl_conn_cf_discard_chain()
154 cfn = cf->next; in Curl_conn_cf_discard_chain()
158 cf->next = NULL; in Curl_conn_cf_discard_chain()
159 cf->cft->destroy(cf, data); in Curl_conn_cf_discard_chain()
160 free(cf); in Curl_conn_cf_discard_chain()
161 cf = cfn; in Curl_conn_cf_discard_chain()
174 struct Curl_cfilter *cf; in Curl_conn_close() local
178 cf = data->conn->cfilter[index]; in Curl_conn_close()
179 if(cf) { in Curl_conn_close()
180 cf->cft->do_close(cf, data); in Curl_conn_close()
187 struct Curl_cfilter *cf; in Curl_conn_shutdown() local
194 cf = data->conn->cfilter[sockindex]; in Curl_conn_shutdown()
195 while(cf && (!cf->connected || cf->shutdown)) in Curl_conn_shutdown()
196 cf = cf->next; in Curl_conn_shutdown()
198 if(!cf) { in Curl_conn_shutdown()
219 while(cf) { in Curl_conn_shutdown()
220 if(!cf->shutdown) { 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()
232 cf->shutdown = TRUE; in Curl_conn_shutdown()
234 cf = cf->next; in Curl_conn_shutdown()
243 struct Curl_cfilter *cf; in Curl_cf_recv() local
248 cf = data->conn->cfilter[num]; in Curl_cf_recv()
249 while(cf && !cf->connected) { in Curl_cf_recv()
250 cf = cf->next; in Curl_cf_recv()
252 if(cf) { in Curl_cf_recv()
253 ssize_t nread = cf->cft->do_recv(cf, data, buf, len, code); in Curl_cf_recv()
267 struct Curl_cfilter *cf; in Curl_cf_send() local
272 cf = data->conn->cfilter[num]; in Curl_cf_send()
273 while(cf && !cf->connected) { in Curl_cf_send()
274 cf = cf->next; in Curl_cf_send()
276 if(cf) { in Curl_cf_send()
277 ssize_t nwritten = cf->cft->do_send(cf, data, mem, len, eos, code); in Curl_cf_send()
292 struct Curl_cfilter *cf; in Curl_cf_create() local
296 cf = calloc(1, sizeof(*cf)); in Curl_cf_create()
297 if(!cf) in Curl_cf_create()
300 cf->cft = cft; in Curl_cf_create()
301 cf->ctx = ctx; in Curl_cf_create()
304 *pcf = cf; in Curl_cf_create()
311 struct Curl_cfilter *cf) in Curl_conn_cf_add() argument
315 DEBUGASSERT(!cf->conn); in Curl_conn_cf_add()
316 DEBUGASSERT(!cf->next); in Curl_conn_cf_add()
318 cf->next = conn->cfilter[index]; in Curl_conn_cf_add()
319 cf->conn = conn; in Curl_conn_cf_add()
320 cf->sockindex = index; in Curl_conn_cf_add()
321 conn->cfilter[index] = cf; in Curl_conn_cf_add()
322 CURL_TRC_CF(data, cf, "added"); in Curl_conn_cf_add()
345 bool Curl_conn_cf_discard_sub(struct Curl_cfilter *cf, in Curl_conn_cf_discard_sub() argument
350 struct Curl_cfilter **pprev = &cf->next; in Curl_conn_cf_discard_sub()
354 DEBUGASSERT(cf); in Curl_conn_cf_discard_sub()
356 if(*pprev == cf) { in Curl_conn_cf_discard_sub()
372 CURLcode Curl_conn_cf_connect(struct Curl_cfilter *cf, in Curl_conn_cf_connect() argument
376 if(cf) in Curl_conn_cf_connect()
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
383 if(cf) in Curl_conn_cf_close()
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
391 if(cf) in Curl_conn_cf_send()
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
400 if(cf) in Curl_conn_cf_recv()
401 return cf->cft->do_recv(cf, data, buf, len, err); in Curl_conn_cf_recv()
411 struct Curl_cfilter *cf; in Curl_conn_connect() local
417 cf = data->conn->cfilter[sockindex]; in Curl_conn_connect()
418 DEBUGASSERT(cf); in Curl_conn_connect()
419 if(!cf) { in Curl_conn_connect()
424 *done = cf->connected; in Curl_conn_connect()
433 result = cf->cft->do_connect(cf, data, blocking, done); in Curl_conn_connect()
453 struct Curl_cfilter *cf; in Curl_conn_is_connected() local
455 cf = conn->cfilter[sockindex]; in Curl_conn_is_connected()
456 return cf && cf->connected; in Curl_conn_is_connected()
461 struct Curl_cfilter *cf; in Curl_conn_is_ip_connected() local
463 cf = data->conn->cfilter[sockindex]; in Curl_conn_is_ip_connected()
464 while(cf) { in Curl_conn_is_ip_connected()
465 if(cf->connected) in Curl_conn_is_ip_connected()
467 if(cf->cft->flags & CF_TYPE_IP_CONNECT) in Curl_conn_is_ip_connected()
469 cf = cf->next; in Curl_conn_is_ip_connected()
474 bool Curl_conn_cf_is_ssl(struct Curl_cfilter *cf) in Curl_conn_cf_is_ssl() argument
476 for(; cf; cf = cf->next) { in Curl_conn_cf_is_ssl()
477 if(cf->cft->flags & CF_TYPE_SSL) in Curl_conn_cf_is_ssl()
479 if(cf->cft->flags & CF_TYPE_IP_CONNECT) in Curl_conn_cf_is_ssl()
492 struct Curl_cfilter *cf = conn ? conn->cfilter[sockindex] : NULL; in Curl_conn_is_multiplex() local
494 for(; cf; cf = cf->next) { in Curl_conn_is_multiplex()
495 if(cf->cft->flags & CF_TYPE_MULTIPLEX) in Curl_conn_is_multiplex()
497 if(cf->cft->flags & CF_TYPE_IP_CONNECT in Curl_conn_is_multiplex()
498 || cf->cft->flags & CF_TYPE_SSL) in Curl_conn_is_multiplex()
506 struct Curl_cfilter *cf; in Curl_conn_data_pending() local
512 cf = data->conn->cfilter[sockindex]; in Curl_conn_data_pending()
513 while(cf && !cf->connected) { in Curl_conn_data_pending()
514 cf = cf->next; in Curl_conn_data_pending()
516 if(cf) { in Curl_conn_data_pending()
517 return cf->cft->has_data_pending(cf, data); in Curl_conn_data_pending()
522 bool Curl_conn_cf_needs_flush(struct Curl_cfilter *cf, 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()
537 void Curl_conn_cf_adjust_pollset(struct Curl_cfilter *cf, in Curl_conn_cf_adjust_pollset() argument
542 while(cf && !cf->connected && cf->next && !cf->next->connected) in Curl_conn_cf_adjust_pollset()
543 cf = cf->next; in Curl_conn_cf_adjust_pollset()
545 while(cf && cf->shutdown) in Curl_conn_cf_adjust_pollset()
546 cf = cf->next; in Curl_conn_cf_adjust_pollset()
549 while(cf) { in Curl_conn_cf_adjust_pollset()
550 cf->cft->adjust_pollset(cf, data, ps); in Curl_conn_cf_adjust_pollset()
551 cf = cf->next; in Curl_conn_cf_adjust_pollset()
567 int Curl_conn_cf_poll(struct Curl_cfilter *cf, in Curl_conn_cf_poll() argument
575 DEBUGASSERT(cf); in Curl_conn_cf_poll()
581 Curl_conn_cf_adjust_pollset(cf, data, &ps); in Curl_conn_cf_poll()
607 struct Curl_cfilter *cf; in Curl_conn_get_host() local
610 cf = data->conn->cfilter[sockindex]; in Curl_conn_get_host()
611 if(cf) { in Curl_conn_get_host()
612 cf->cft->get_host(cf, data, phost, pdisplay_host, pport); in Curl_conn_get_host()
625 CURLcode Curl_cf_def_cntrl(struct Curl_cfilter *cf, in Curl_cf_def_cntrl() argument
629 (void)cf; in Curl_cf_def_cntrl()
637 CURLcode Curl_conn_cf_cntrl(struct Curl_cfilter *cf, in Curl_conn_cf_cntrl() argument
644 for(; cf; cf = cf->next) { in Curl_conn_cf_cntrl()
645 if(Curl_cf_def_cntrl == cf->cft->cntrl) in Curl_conn_cf_cntrl()
647 result = cf->cft->cntrl(cf, data, event, arg1, arg2); in Curl_conn_cf_cntrl()
654 curl_socket_t Curl_conn_cf_get_socket(struct Curl_cfilter *cf, 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()
663 CURLcode Curl_conn_cf_get_ip_info(struct Curl_cfilter *cf, in Curl_conn_cf_get_ip_info() argument
667 if(cf) in Curl_conn_cf_get_ip_info()
668 return cf->cft->query(cf, data, CF_QUERY_IP_INFO, is_ipv6, ipquad); in Curl_conn_cf_get_ip_info()
674 struct Curl_cfilter *cf; in Curl_conn_get_socket() local
676 cf = data->conn ? data->conn->cfilter[sockindex] : NULL; in Curl_conn_get_socket()
680 if(cf && !cf->connected) in Curl_conn_get_socket()
681 return Curl_conn_cf_get_socket(cf, data); in Curl_conn_get_socket()
688 struct Curl_cfilter *cf = data->conn->cfilter[sockindex]; in Curl_conn_forget_socket() local
689 if(cf) in Curl_conn_forget_socket()
690 (void)Curl_conn_cf_cntrl(cf, data, TRUE, in Curl_conn_forget_socket()
781 struct Curl_cfilter *cf = conn->cfilter[FIRSTSOCKET]; in conn_report_connect_stats() local
782 if(cf) { in conn_report_connect_stats()
787 cf->cft->query(cf, data, CF_QUERY_TIMER_CONNECT, NULL, &connected); in conn_report_connect_stats()
792 cf->cft->query(cf, data, CF_QUERY_TIMER_APPCONNECT, NULL, &appconnected); in conn_report_connect_stats()
801 struct Curl_cfilter *cf = conn->cfilter[FIRSTSOCKET]; in Curl_conn_is_alive() local
802 return cf && !cf->conn->bits.close && in Curl_conn_is_alive()
803 cf->cft->is_alive(cf, data, input_pending); in Curl_conn_is_alive()
810 struct Curl_cfilter *cf = conn->cfilter[sockindex]; in Curl_conn_keep_alive() local
811 return cf ? cf->cft->keep_alive(cf, data) : CURLE_OK; in Curl_conn_keep_alive()
821 struct Curl_cfilter *cf = conn->cfilter[sockindex]; in Curl_conn_get_max_concurrent() local
822 result = cf ? cf->cft->query(cf, data, CF_QUERY_MAX_CONCURRENT, in Curl_conn_get_max_concurrent()
834 struct Curl_cfilter *cf = conn->cfilter[sockindex]; in Curl_conn_get_stream_error() local
835 result = cf ? cf->cft->query(cf, data, CF_QUERY_STREAM_ERROR, in Curl_conn_get_stream_error()