Lines Matching refs:proxy

76 	struct Proxy *proxy = (struct Proxy *)(source->ptr);  in spdy_cb_data_source_read()  local
86 if(!proxy->received_body_size)//nothing to write now in spdy_cb_data_source_read()
88 if(proxy->receiving_done) in spdy_cb_data_source_read()
97 if(length >= proxy->received_body_size) in spdy_cb_data_source_read()
99 ret = proxy->received_body_size; in spdy_cb_data_source_read()
105 if(NULL == (newbody = malloc(proxy->received_body_size - length))) in spdy_cb_data_source_read()
110 memcpy(newbody, proxy->received_body + length, proxy->received_body_size - length); in spdy_cb_data_source_read()
112 memcpy(buf, proxy->received_body, ret); in spdy_cb_data_source_read()
113 free(proxy->received_body); in spdy_cb_data_source_read()
114 proxy->received_body = newbody; in spdy_cb_data_source_read()
115 proxy->received_body_size -= ret; in spdy_cb_data_source_read()
117 if(0 == proxy->received_body_size && proxy->receiving_done) in spdy_cb_data_source_read()
294 struct Proxy *proxy; in spdy_cb_before_ctrl_send() local
299 proxy = spdylay_session_get_stream_user_data(session, stream_id); in spdy_cb_before_ctrl_send()
300 proxy->stream_id = stream_id; in spdy_cb_before_ctrl_send()
302 ++proxy->spdy_connection->streams_opened; in spdy_cb_before_ctrl_send()
303 PRINT_INFO2("opening stream: str open %i; %s", glob_opt.streams_opened, proxy->url); in spdy_cb_before_ctrl_send()
330 struct Proxy * proxy; in spdy_cb_on_ctrl_recv() local
349 proxy = spdylay_session_get_stream_user_data(session, stream_id); in spdy_cb_on_ctrl_recv()
350 if(NULL == proxy) in spdy_cb_on_ctrl_recv()
359 PRINT_INFO2("received headers for %s", proxy->url); in spdy_cb_on_ctrl_recv()
360 http_create_response(proxy, nv); in spdy_cb_on_ctrl_recv()
363 PRINT_INFO2("received reset stream for %s", proxy->url); in spdy_cb_on_ctrl_recv()
364 proxy->spdy_error = true; in spdy_cb_on_ctrl_recv()
367 PRINT_INFO2("received headers for %s", proxy->url); in spdy_cb_on_ctrl_recv()
368 http_create_response(proxy, nv); in spdy_cb_on_ctrl_recv()
394 struct Proxy * proxy = spdylay_session_get_stream_user_data(session, stream_id); in spdy_cb_on_stream_close() local
396 assert(NULL != proxy); in spdy_cb_on_stream_close()
399 --proxy->spdy_connection->streams_opened; in spdy_cb_on_stream_close()
400 PRINT_INFO2("closing stream: str opened %i; remove proxy %i", glob_opt.streams_opened, proxy->id); in spdy_cb_on_stream_close()
402 DLL_remove(proxy->spdy_connection->proxies_head, proxy->spdy_connection->proxies_tail, proxy); in spdy_cb_on_stream_close()
403 if(proxy->http_active) in spdy_cb_on_stream_close()
405 proxy->spdy_active = false; in spdy_cb_on_stream_close()
409 free_proxy(proxy); in spdy_cb_on_stream_close()
429 struct Proxy *proxy; in spdy_cb_on_data_chunk_recv() local
430 proxy = spdylay_session_get_stream_user_data(session, stream_id); in spdy_cb_on_data_chunk_recv()
432 if(NULL == proxy) in spdy_cb_on_data_chunk_recv()
438 if(!copy_buffer(data, len, &proxy->http_body, &proxy->http_body_size)) in spdy_cb_on_data_chunk_recv()
458 PRINT_INFO2("received data for %s; %zu bytes", proxy->url, len); in spdy_cb_on_data_chunk_recv()
475 struct Proxy *proxy; in spdy_cb_on_data_recv() local
476 proxy = spdylay_session_get_stream_user_data(session, stream_id); in spdy_cb_on_data_recv()
477 proxy->done = true; in spdy_cb_on_data_recv()
478 PRINT_INFO2("last data frame received for %s", proxy->url); in spdy_cb_on_data_recv()
815 struct Proxy *proxy; in spdy_free_connection() local
820 for(proxy = connection->proxies_head; NULL != proxy; proxy=proxy_next) in spdy_free_connection()
822 proxy_next = proxy->next; in spdy_free_connection()
823 DLL_remove(connection->proxies_head, connection->proxies_tail, proxy); in spdy_free_connection()
824 proxy->spdy_active = false; in spdy_free_connection()
825 proxy->spdy_error = true; in spdy_free_connection()
826 PRINT_INFO2("spdy_free_connection for id %i", proxy->id); in spdy_free_connection()
827 if(!proxy->http_active) in spdy_free_connection()
829 free_proxy(proxy); in spdy_free_connection()
843 struct Proxy *proxy, in spdy_request() argument
860 if(0 == strcasecmp(proxy->uri->host, connection->host)) in spdy_request()
868 port = proxy->uri->port; in spdy_request()
870 connection = spdy_connect(proxy->uri, port, true); in spdy_request()
887 proxy->spdy_connection = connection; in spdy_request()
890 post_data.source.ptr = proxy; 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()
900 PRINT_INFO2("adding proxy %i", proxy->id); in spdy_request()
903 DLL_insert(connection->proxies_head, connection->proxies_tail, proxy); in spdy_request()