aboutsummaryrefslogtreecommitdiffstats
path: root/proxy/proxy_http_rewriter.c
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-01-09 17:51:21 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-01-09 17:51:21 -0800
commitc2db2b6accc7888df514261a7240e7759df95a4c (patch)
tree0d7ecd37a534c15348cbad01d0d1f84183b7b4d8 /proxy/proxy_http_rewriter.c
parentdf7881f07f53b041dc0568be8528e9dbb74994cc (diff)
downloadexternal_qemu-c2db2b6accc7888df514261a7240e7759df95a4c.zip
external_qemu-c2db2b6accc7888df514261a7240e7759df95a4c.tar.gz
external_qemu-c2db2b6accc7888df514261a7240e7759df95a4c.tar.bz2
auto import from //branches/cupcake/...@125939
Diffstat (limited to 'proxy/proxy_http_rewriter.c')
-rw-r--r--proxy/proxy_http_rewriter.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/proxy/proxy_http_rewriter.c b/proxy/proxy_http_rewriter.c
index 3e98557..f0bfbbc 100644
--- a/proxy/proxy_http_rewriter.c
+++ b/proxy/proxy_http_rewriter.c
@@ -364,23 +364,16 @@ rewrite_connection_init( RewriteConnection* conn )
{
HttpService* service = (HttpService*) conn->root->service;
ProxyConnection* root = conn->root;
- int ret;
conn->slirp_fd = -1;
conn->state = STATE_CONNECTING;
- do {
- ret = connect( root->socket,
- (struct sockaddr*) &service->server_addr,
- sizeof(service->server_addr) );
- } while (ret < 0 && socket_errno == EINTR);
-
- if (ret < 0) {
- if (socket_errno == EINPROGRESS || socket_errno == EWOULDBLOCK) {
+ if (socket_connect( root->socket, &service->server_addr ) < 0) {
+ if (errno == EINPROGRESS || errno == EWOULDBLOCK) {
PROXY_LOG("%s: connecting", conn->root->name);
}
else {
- PROXY_LOG("%s: cannot connect to proxy: %s", root->name, socket_errstr());
+ PROXY_LOG("%s: cannot connect to proxy: %s", root->name, errno_str);
return -1;
}
}
@@ -401,7 +394,7 @@ rewrite_connection_create_sockets( RewriteConnection* conn )
if (socket_pair( &slirp_1, &conn->slirp_fd ) < 0) {
PROXY_LOG("%s: coult not create socket pair: %s",
- root->name, socket_errstr());
+ root->name, errno_str);
return -1;
}
@@ -1102,13 +1095,13 @@ rewrite_connection_poll( ProxyConnection* root,
ProxyConnection*
-http_rewriter_connect( HttpService* service,
- struct sockaddr_in* address )
+http_rewriter_connect( HttpService* service,
+ SockAddress* address )
{
RewriteConnection* conn;
int s;
- s = socket(AF_INET, SOCK_STREAM, 0);
+ s = socket_create_inet( SOCKET_STREAM );
if (s < 0)
return NULL;