Lines Matching refs:connection
146 struct SPDY_Connection *connection; in spdy_cb_send() local
148 connection = (struct SPDY_Connection*)user_data; in spdy_cb_send()
149 connection->want_io = IO_NONE; in spdy_cb_send()
164 if(connection->is_tls) in spdy_cb_send()
167 rv = SSL_write(connection->ssl, data, length); in spdy_cb_send()
169 int err = SSL_get_error(connection->ssl, rv); in spdy_cb_send()
171 connection->want_io |= (err == SSL_ERROR_WANT_READ ? in spdy_cb_send()
181 rv = write(connection->fd, in spdy_cb_send()
193 connection->want_io |= WANT_WRITE; in spdy_cb_send()
228 struct SPDY_Connection *connection; in spdy_cb_recv() local
231 connection = (struct SPDY_Connection*)user_data; in spdy_cb_recv()
233 if(!(++connection->counter % 10)) return SPDYLAY_ERR_WOULDBLOCK; in spdy_cb_recv()
234 connection->want_io = IO_NONE; in spdy_cb_recv()
235 if(connection->is_tls) in spdy_cb_recv()
238 rv = SSL_read(connection->ssl, buf, length); in spdy_cb_recv()
240 int err = SSL_get_error(connection->ssl, rv); in spdy_cb_recv()
242 connection->want_io |= (err == SSL_ERROR_WANT_READ ? in spdy_cb_recv()
254 rv = read(connection->fd, in spdy_cb_recv()
266 connection->want_io |= WANT_READ; in spdy_cb_recv()
674 struct SPDY_Connection *connection) in spdy_ctl_select() argument
680 if(spdylay_session_want_read(connection->session) || in spdy_ctl_select()
681 connection->want_io & WANT_READ) in spdy_ctl_select()
683 FD_SET(connection->fd, read_fd_set); in spdy_ctl_select()
686 if(spdylay_session_want_write(connection->session) || in spdy_ctl_select()
687 connection->want_io & WANT_WRITE) in spdy_ctl_select()
689 FD_SET(connection->fd, write_fd_set); in spdy_ctl_select()
701 spdy_exec_io(struct SPDY_Connection *connection) in spdy_exec_io() argument
705 rv = spdylay_session_recv(connection->session); in spdy_exec_io()
711 rv = spdylay_session_send(connection->session); in spdy_exec_io()
730 struct SPDY_Connection * connection = NULL; in spdy_connect() local
768 if(NULL == (connection = au_malloc(sizeof(struct SPDY_Connection)))) in spdy_connect()
771 connection->is_tls = is_tls; in spdy_connect()
772 connection->ssl = ssl; in spdy_connect()
773 connection->want_io = IO_NONE; in spdy_connect()
774 if(NULL == (connection->host = strdup(uri->host))) in spdy_connect()
782 rv = spdylay_session_client_new(&(connection->session), glob_opt.spdy_proto_version, in spdy_connect()
783 &callbacks, connection); in spdy_connect()
788 connection->fd = fd; in spdy_connect()
790 return connection; in spdy_connect()
794 if(NULL != connection) in spdy_connect()
796 free(connection->host); in spdy_connect()
797 free(connection); in spdy_connect()
813 spdy_free_connection(struct SPDY_Connection * connection) in spdy_free_connection() argument
818 if(NULL != connection) in spdy_free_connection()
820 for(proxy = connection->proxies_head; NULL != proxy; proxy=proxy_next) in spdy_free_connection()
823 DLL_remove(connection->proxies_head, connection->proxies_tail, proxy); in spdy_free_connection()
832 spdylay_session_del(connection->session); in spdy_free_connection()
833 SSL_free(connection->ssl); in spdy_free_connection()
834 free(connection->host); in spdy_free_connection()
835 free(connection); in spdy_free_connection()
848 struct SPDY_Connection *connection; in spdy_request() local
853 connection = glob_opt.spdy_connection; in spdy_request()
857 connection = glob_opt.spdy_connections_head; in spdy_request()
858 while(NULL != connection) in spdy_request()
860 if(0 == strcasecmp(proxy->uri->host, connection->host)) in spdy_request()
862 connection = connection->next; in spdy_request()
865 if(NULL == connection) in spdy_request()
870 connection = spdy_connect(proxy->uri, port, true); in spdy_request()
871 if(NULL != connection) in spdy_request()
873 DLL_insert(glob_opt.spdy_connections_head, glob_opt.spdy_connections_tail, connection); in spdy_request()
877 connection = glob_opt.spdy_connection; in spdy_request()
881 if(NULL == connection) in spdy_request()
887 proxy->spdy_connection = connection; in spdy_request()
892 ret = spdylay_submit_request(connection->session, 0, nv, &post_data, proxy); in spdy_request()
895 ret = spdylay_submit_request(connection->session, 0, nv, NULL, proxy); in spdy_request()
901 if(NULL != connection->proxies_head) in spdy_request()
902 PRINT_INFO2("before proxy %i", connection->proxies_head->id); in spdy_request()
903 DLL_insert(connection->proxies_head, connection->proxies_tail, proxy); in spdy_request()
990 struct SPDY_Connection *connection; in spdy_get_selectfdset() local
1020 connection = glob_opt.spdy_connections_head; in spdy_get_selectfdset()
1022 while(NULL != connection && *real_size < max_size) in spdy_get_selectfdset()
1027 except_fd_set, connection); in spdy_get_selectfdset()
1029 next_connection = connection->next; in spdy_get_selectfdset()
1032 glob_opt.streams_opened -= connection->streams_opened; in spdy_get_selectfdset()
1033 DLL_remove(glob_opt.spdy_connections_head, glob_opt.spdy_connections_tail, connection); in spdy_get_selectfdset()
1037 spdy_free_connection(connection); in spdy_get_selectfdset()
1041 connections[*real_size] = connection; in spdy_get_selectfdset()
1043 if(maxfd < connection->fd) maxfd = connection->fd; in spdy_get_selectfdset()
1045 connection = next_connection; in spdy_get_selectfdset()
1049 assert(NULL == connection); in spdy_get_selectfdset()