diff options
author | Jeff Trawick <trawick@apache.org> | 2003-09-03 21:27:12 +0200 |
---|---|---|
committer | Jeff Trawick <trawick@apache.org> | 2003-09-03 21:27:12 +0200 |
commit | aa21671e13767135f0ee3f88d6a3ff6d039e6534 (patch) | |
tree | 4076c4ce92c1c44bd68937d2550b470462fb4892 /modules/proxy | |
parent | Point to the correct download location. (diff) | |
download | apache2-aa21671e13767135f0ee3f88d6a3ff6d039e6534.tar.xz apache2-aa21671e13767135f0ee3f88d6a3ff6d039e6534.zip |
switch to APR 1.0 API (which is still in flux)
because of the changes to the argument lists of apr_mmap_dup and apr_socket_create,
2.1-dev won't build with apr and apr-util's 0.9 branch anymore
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101154 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/proxy')
-rw-r--r-- | modules/proxy/proxy_connect.c | 16 | ||||
-rw-r--r-- | modules/proxy/proxy_ftp.c | 20 | ||||
-rw-r--r-- | modules/proxy/proxy_http.c | 2 | ||||
-rw-r--r-- | modules/proxy/proxy_util.c | 4 |
4 files changed, 21 insertions, 21 deletions
diff --git a/modules/proxy/proxy_connect.c b/modules/proxy/proxy_connect.c index 057b1ce7fe..e755335489 100644 --- a/modules/proxy/proxy_connect.c +++ b/modules/proxy/proxy_connect.c @@ -267,10 +267,10 @@ int ap_proxy_connect_handler(request_rec *r, proxy_server_conf *conf, "proxy: CONNECT: sending the CONNECT request to the remote proxy"); nbytes = apr_snprintf(buffer, sizeof(buffer), "CONNECT %s HTTP/1.0" CRLF, r->uri); - apr_send(sock, buffer, &nbytes); + apr_socket_send(sock, buffer, &nbytes); nbytes = apr_snprintf(buffer, sizeof(buffer), "Proxy-agent: %s" CRLF CRLF, ap_get_server_version()); - apr_send(sock, buffer, &nbytes); + apr_socket_send(sock, buffer, &nbytes); } else { ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, @@ -278,11 +278,11 @@ int ap_proxy_connect_handler(request_rec *r, proxy_server_conf *conf, nbytes = apr_snprintf(buffer, sizeof(buffer), "HTTP/1.0 200 Connection Established" CRLF); ap_xlate_proto_to_ascii(buffer, nbytes); - apr_send(client_socket, buffer, &nbytes); + apr_socket_send(client_socket, buffer, &nbytes); nbytes = apr_snprintf(buffer, sizeof(buffer), "Proxy-agent: %s" CRLF CRLF, ap_get_server_version()); ap_xlate_proto_to_ascii(buffer, nbytes); - apr_send(client_socket, buffer, &nbytes); + apr_socket_send(client_socket, buffer, &nbytes); #if 0 /* This is safer code, but it doesn't work yet. I'm leaving it * here so that I can fix it later. @@ -336,7 +336,7 @@ int ap_proxy_connect_handler(request_rec *r, proxy_server_conf *conf, /* ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy: CONNECT: sock was set");*/ nbytes = sizeof(buffer); - if (apr_recv(sock, buffer, &nbytes) == APR_SUCCESS) { + if (apr_socket_recv(sock, buffer, &nbytes) == APR_SUCCESS) { o = 0; i = nbytes; while(i > 0) @@ -348,7 +348,7 @@ int ap_proxy_connect_handler(request_rec *r, proxy_server_conf *conf, * if ((nbytes = ap_rwrite(buffer + o, nbytes, r)) < 0) * rbb */ - if (apr_send(client_socket, buffer + o, &nbytes) != APR_SUCCESS) + if (apr_socket_send(client_socket, buffer + o, &nbytes) != APR_SUCCESS) break; o += nbytes; i -= nbytes; @@ -366,13 +366,13 @@ int ap_proxy_connect_handler(request_rec *r, proxy_server_conf *conf, /* ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy: CONNECT: client was set");*/ nbytes = sizeof(buffer); - if (apr_recv(client_socket, buffer, &nbytes) == APR_SUCCESS) { + if (apr_socket_recv(client_socket, buffer, &nbytes) == APR_SUCCESS) { o = 0; i = nbytes; while(i > 0) { nbytes = i; - if (apr_send(sock, buffer + o, &nbytes) != APR_SUCCESS) + if (apr_socket_send(sock, buffer + o, &nbytes) != APR_SUCCESS) break; o += nbytes; i -= nbytes; diff --git a/modules/proxy/proxy_ftp.c b/modules/proxy/proxy_ftp.c index c38773cb6b..8df516a680 100644 --- a/modules/proxy/proxy_ftp.c +++ b/modules/proxy/proxy_ftp.c @@ -954,7 +954,7 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf, int failed = 1; while (connect_addr) { - if ((rv = apr_socket_create(&sock, connect_addr->family, SOCK_STREAM, r->pool)) != APR_SUCCESS) { + if ((rv = apr_socket_create(&sock, connect_addr->family, SOCK_STREAM, 0, r->pool)) != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "proxy: FTP: error creating socket"); connect_addr = connect_addr->next; @@ -993,7 +993,7 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf, connect_addr->family, connect_addr, connectname); /* make the connection out of the socket */ - rv = apr_connect(sock, connect_addr); + rv = apr_socket_connect(sock, connect_addr); /* if an error occurred, loop round and try again */ if (rv != APR_SUCCESS) { @@ -1272,7 +1272,7 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf, "proxy: FTP: EPSV contacting remote host on port %d", data_port); - if ((rv = apr_socket_create(&data_sock, connect_addr->family, SOCK_STREAM, r->pool)) != APR_SUCCESS) { + if ((rv = apr_socket_create(&data_sock, connect_addr->family, SOCK_STREAM, 0, r->pool)) != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "proxy: FTP: error creating EPSV socket"); return HTTP_INTERNAL_SERVER_ERROR; @@ -1291,7 +1291,7 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf, apr_socket_addr_get(&data_addr, APR_REMOTE, sock); apr_sockaddr_ip_get(&data_ip, data_addr); apr_sockaddr_info_get(&epsv_addr, data_ip, connect_addr->family, data_port, 0, p); - rv = apr_connect(data_sock, epsv_addr); + rv = apr_socket_connect(data_sock, epsv_addr); if (rv != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server, "proxy: FTP: EPSV attempt to connect to %pI failed - Firewall/NAT?", epsv_addr); @@ -1359,7 +1359,7 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf, "proxy: FTP: PASV contacting host %d.%d.%d.%d:%d", h3, h2, h1, h0, pasvport); - if ((rv = apr_socket_create(&data_sock, connect_addr->family, SOCK_STREAM, r->pool)) != APR_SUCCESS) { + if ((rv = apr_socket_create(&data_sock, connect_addr->family, SOCK_STREAM, 0, r->pool)) != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "proxy: error creating PASV socket"); return HTTP_INTERNAL_SERVER_ERROR; @@ -1376,7 +1376,7 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf, /* make the connection */ apr_sockaddr_info_get(&pasv_addr, apr_psprintf(p, "%d.%d.%d.%d", h3, h2, h1, h0), connect_addr->family, pasvport, 0, p); - rv = apr_connect(data_sock, pasv_addr); + rv = apr_socket_connect(data_sock, pasv_addr); if (rv != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server, "proxy: FTP: PASV attempt to connect to %pI failed - Firewall/NAT?", pasv_addr); @@ -1402,7 +1402,7 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf, apr_port_t local_port; unsigned int h0, h1, h2, h3, p0, p1; - if ((rv = apr_socket_create(&local_sock, connect_addr->family, SOCK_STREAM, r->pool)) != APR_SUCCESS) { + if ((rv = apr_socket_create(&local_sock, connect_addr->family, SOCK_STREAM, 0, r->pool)) != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "proxy: FTP: error creating local socket"); return HTTP_INTERNAL_SERVER_ERROR; @@ -1422,14 +1422,14 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf, apr_sockaddr_info_get(&local_addr, local_ip, APR_UNSPEC, local_port, 0, r->pool); - if ((rv = apr_bind(local_sock, local_addr)) != APR_SUCCESS) { + if ((rv = apr_socket_bind(local_sock, local_addr)) != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "proxy: FTP: error binding to ftp data socket %pI", local_addr); return HTTP_INTERNAL_SERVER_ERROR; } /* only need a short queue */ - if ((rv = apr_listen(local_sock, 2)) != APR_SUCCESS) { + if ((rv = apr_socket_listen(local_sock, 2)) != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "proxy: FTP: error listening to ftp data socket %pI", local_addr); return HTTP_INTERNAL_SERVER_ERROR; @@ -1766,7 +1766,7 @@ int ap_proxy_ftp_handler(request_rec *r, proxy_server_conf *conf, /* wait for connection */ if (use_port) { for (;;) { - rv = apr_accept(&data_sock, local_sock, r->pool); + rv = apr_socket_accept(&data_sock, local_sock, r->pool); if (rv == APR_EINTR) { continue; } diff --git a/modules/proxy/proxy_http.c b/modules/proxy/proxy_http.c index e71d54b707..a3250865c0 100644 --- a/modules/proxy/proxy_http.c +++ b/modules/proxy/proxy_http.c @@ -330,7 +330,7 @@ apr_status_t ap_proxy_http_create_connection(apr_pool_t *p, request_rec *r, apr_socket_timeout_get(p_conn->sock, ¤t_timeout); /* set no timeout */ apr_socket_timeout_set(p_conn->sock, 0); - socket_status = apr_recv(p_conn->sock, test_buffer, &buffer_len); + socket_status = apr_socket_recv(p_conn->sock, test_buffer, &buffer_len); /* put back old timeout */ apr_socket_timeout_set(p_conn->sock, current_timeout); if ( APR_STATUS_IS_EOF(socket_status) ) { diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 0b23bf8b56..bbbb437cba 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -1167,7 +1167,7 @@ PROXY_DECLARE(int) ap_proxy_connect_to_backend(apr_socket_t **newsock, while (backend_addr && !connected) { if ((rv = apr_socket_create(newsock, backend_addr->family, - SOCK_STREAM, p)) != APR_SUCCESS) { + SOCK_STREAM, 0, p)) != APR_SUCCESS) { loglevel = backend_addr->next ? APLOG_DEBUG : APLOG_ERR; ap_log_error(APLOG_MARK, loglevel, rv, s, "proxy: %s: error creating fam %d socket for target %s", @@ -1205,7 +1205,7 @@ PROXY_DECLARE(int) ap_proxy_connect_to_backend(apr_socket_t **newsock, proxy_function, backend_addr->family, backend_name); /* make the connection out of the socket */ - rv = apr_connect(*newsock, backend_addr); + rv = apr_socket_connect(*newsock, backend_addr); /* if an error occurred, loop round and try again */ if (rv != APR_SUCCESS) { |