Lines Matching refs:root
323 /* root->socket is connected to the proxy server. while
341 ProxyConnection root[1];
360 rewrite_connection_free( ProxyConnection* root )
362 RewriteConnection* conn = (RewriteConnection*)root;
369 proxy_connection_done(root);
377 HttpService* service = (HttpService*) conn->root->service;
378 ProxyConnection* root = conn->root;
383 if (socket_connect( root->socket, &service->server_addr ) < 0) {
385 PROXY_LOG("%s: connecting", conn->root->name);
388 PROXY_LOG("%s: cannot connect to proxy: %s", root->name, errno_str);
393 PROXY_LOG("%s: immediate connection", root->name);
405 ProxyConnection* root = conn->root;
409 root->name, errno_str);
413 root->ev_func( root->ev_opaque, slirp_1, PROXY_EVENT_CONNECTED );
423 ProxyConnection* root = conn->root;
426 ret = proxy_connection_receive_line(root, conn->slirp_fd);
429 char* line = root->str->s;
438 root->name, line);
444 root->name, line);
450 root->name, line);
460 proxy_connection_rewind(root);
469 ProxyConnection* root = conn->root;
472 ret = proxy_connection_receive_line( root, root->socket );
476 char* line = stralloc_cstr( root->str );
485 root->name, line);
491 root->name, line);
499 proxy_connection_rewind(root);
510 ProxyConnection* root = conn->root;
514 stralloc_t* str = root->str;
516 ret = proxy_connection_receive_line(root, fd);
540 PROXY_LOG("%s: can't parse header '%s'", root->name, line);
557 ProxyConnection* root = conn->root;
558 HttpService* service = (HttpService*) root->service;
560 stralloc_t* str = root->str;
563 proxy_connection_rewind(conn->root);
569 PROXY_LOG("%s: uh oh, not Host: in request ?", root->name);
576 proxy_connection_rewind(root);
594 ProxyConnection* root = conn->root;
595 stralloc_t* str = root->str;
598 proxy_connection_rewind(root);
614 ProxyConnection* root = conn->root;
626 proxy_connection_rewind(root);
648 PROXY_LOG("%s: bad content length: %s", root->name, content_length);
675 root->name);
684 root->name, conn->body_length,
687 proxy_connection_rewind(root);
696 ProxyConnection* root = conn->root;
697 stralloc_t* str = root->str;
708 D("%s: INTERNAL ERROR: SHOULDN'T BE THERE", root->name);
734 D("%s: waiting chunk header", root->name);
737 ret = proxy_connection_receive_line(root, fd);
746 root->name, line);
751 root->name, length);
758 stralloc_add_str(root->str, "\r\n");
804 root->name, current);
811 ret = proxy_connection_receive(root, fd, wanted);
819 conn->body_total += root->str_recv;
821 root->name, conn->body_total);
826 avail = root->str_recv;
836 root->name, conn->chunk_length);
849 root->name, conn->body_total);
869 ProxyConnection* root = conn->root;
870 stralloc_t* str = root->str;
874 ret = proxy_connection_send(root, fd);
876 int pos = root->str_pos;
880 root->str_pos = 0;
883 conn->body_sent += root->str_sent;
893 root->name, conn->body_sent);
897 root->name, conn->body_is_closed,
907 rewrite_connection_select( ProxyConnection* root,
910 RewriteConnection* conn = (RewriteConnection*)root;
912 int proxy = root->socket;
960 rewrite_connection_poll( ProxyConnection* root,
963 RewriteConnection* conn = (RewriteConnection*)root;
966 int proxy = root->socket;
974 PROXY_LOG("%s: connected to proxy", root->name);
984 D("%s: socket pair created", root->name);
994 PROXY_LOG("%s: request first line ok", root->name);
1004 PROXY_LOG("%s: request headers ok", root->name);
1015 ret = proxy_connection_send(root, proxy);
1021 root->name);
1025 root->name);
1040 root->name);
1050 PROXY_LOG("%s: reply first line ok", root->name);
1060 PROXY_LOG("%s: reply headers ok", root->name);
1071 ret = proxy_connection_send(conn->root, slirp);
1077 root->name);
1081 root->name);
1096 PROXY_LOG("%s: closing connection", root->name);
1100 root->name);
1111 proxy_connection_free(root, 0, PROXY_EVENT_NONE);
1134 proxy_connection_init( conn->root, s, address, service->root,
1140 rewrite_connection_free( conn->root );
1144 return conn->root;