Lines Matching refs:root
33 ProxyConnection root[1];
39 connection_free( ProxyConnection* root )
41 proxy_connection_done(root);
42 qemu_free(root);
52 HttpService* service = (HttpService*) conn->root->service;
53 ProxyConnection* root = conn->root;
54 stralloc_t* str = root->str;
56 proxy_connection_rewind(root);
58 sock_address_to_string(&root->address));
62 if (!socket_connect( root->socket, &service->server_addr )) {
65 PROXY_LOG("%s: immediate connection", root->name);
70 PROXY_LOG("%s: connecting", root->name);
73 PROXY_LOG("%s: cannot connect to proxy: %s", root->name, errno_str);
82 connection_select( ProxyConnection* root,
86 Connection* conn = (Connection*)root;
102 proxy_select_set(sel, root->socket, flags);
106 connection_poll( ProxyConnection* root,
110 Connection* conn = (Connection*)root;
111 int fd = root->socket;
119 PROXY_LOG("%s: connected to http proxy, sending header", root->name);
124 ret = proxy_connection_send(root, fd);
127 PROXY_LOG("%s: header sent, receiving first answer line", root->name);
133 ret = proxy_connection_receive_line(root, root->socket);
137 const char* line = root->str->s;
141 root->name, line );
149 root->name, codenum );
150 proxy_connection_free( root, 0, PROXY_EVENT_CONNECTION_REFUSED );
153 PROXY_LOG("%s: receiving second answer line", root->name);
155 proxy_connection_rewind(root);
158 PROXY_LOG("%s: connection succeeded", root->name);
159 proxy_connection_free( root, 1, PROXY_EVENT_CONNECTED );
165 PROXY_LOG("%s: invalid state for read event: %d", root->name, conn->state);
169 proxy_connection_free( root, 0, PROXY_EVENT_SERVER_ERROR );
192 proxy_connection_init( conn->root, s, address, service->root,
198 connection_free( conn->root );
202 return conn->root;