From: Jeff Trawick Date: Sun, 19 Nov 2000 14:27:45 +0000 (+0000) Subject: Call apr_create_socket() instead of apr_create_tcp_socket() (deprecated). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fe10af52bed578a750b5d46bb95793a50a95b41f;p=apache Call apr_create_socket() instead of apr_create_tcp_socket() (deprecated). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87025 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/proxy_connect.c b/modules/proxy/proxy_connect.c index 0563f01964..9b8c277bf5 100644 --- a/modules/proxy/proxy_connect.c +++ b/modules/proxy/proxy_connect.c @@ -172,7 +172,7 @@ int ap_proxy_connect_handler(request_rec *r, char *url, "CONNECT to %s on port %d", host, port); } - if ((apr_create_tcp_socket(&sock, r->pool)) != APR_SUCCESS) { + if ((apr_create_socket(&sock, APR_INET, SOCK_STREAM, r->pool)) != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "proxy: error creating socket"); return HTTP_INTERNAL_SERVER_ERROR; diff --git a/modules/proxy/proxy_http.c b/modules/proxy/proxy_http.c index b14c3f5b8e..e679f1931b 100644 --- a/modules/proxy/proxy_http.c +++ b/modules/proxy/proxy_http.c @@ -246,7 +246,7 @@ int ap_proxy_http_handler(request_rec *r, char *url, "Connect to remote machine blocked"); } - if ((apr_create_tcp_socket(&sock, r->pool)) != APR_SUCCESS) { + if ((apr_create_socket(&sock, APR_INET, SOCK_STREAM, r->pool)) != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "proxy: error creating socket"); return HTTP_INTERNAL_SERVER_ERROR; diff --git a/support/ab.c b/support/ab.c index 5b64d93db9..c2d107b767 100644 --- a/support/ab.c +++ b/support/ab.c @@ -492,11 +492,16 @@ static void start_connect(struct connection *c) c->cbx = 0; c->gotheader = 0; - if ((rv = apr_getaddrinfo(&destsa, hostname, AF_INET, port, 0, cntxt)) + if ((rv = apr_getaddrinfo(&destsa, hostname, APR_UNSPEC, port, 0, cntxt)) != APR_SUCCESS) { - apr_err("apr_getaddrinfo()", rv); + char buf[120]; + + apr_snprintf(buf, sizeof(buf), + "apr_getaddrinfo() for %s", hostname); + apr_err(buf, rv); } - if ((rv = apr_create_tcp_socket(&c->aprsock, cntxt)) != APR_SUCCESS) { + if ((rv = apr_create_socket(&c->aprsock, destsa->sa.sin.sin_family, + SOCK_STREAM, cntxt)) != APR_SUCCESS) { apr_err("Socket:", rv); } c->start = apr_now(); @@ -878,14 +883,14 @@ static void test(void) static void copyright(void) { if (!use_html) { - printf("This is ApacheBench, Version %s\n", AB_VERSION " <$Revision: 1.33 $> apache-2.0"); + printf("This is ApacheBench, Version %s\n", AB_VERSION " <$Revision: 1.34 $> apache-2.0"); printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n"); printf("Copyright (c) 1998-2000 The Apache Software Foundation, http://www.apache.org/\n"); printf("\n"); } else { printf("

\n"); - printf(" This is ApacheBench, Version %s <%s> apache-2.0
\n", AB_VERSION, "$Revision: 1.33 $"); + printf(" This is ApacheBench, Version %s <%s> apache-2.0
\n", AB_VERSION, "$Revision: 1.34 $"); printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
\n"); printf(" Copyright (c) 1998-2000 The Apache Software Foundation, http://www.apache.org/
\n"); printf("

\n

\n");