if (d->use_canonical_name == USE_CANONICAL_NAME_OFF
|| d->use_canonical_name == USE_CANONICAL_NAME_DNS) {
if (r->hostname)
- apr_get_local_port(&port, r->connection->client_socket);
+ apr_get_port(&port, APR_LOCAL, r->connection->client_socket);
}
/* default */
return port;
apr_port_t port;
char *ipaddr;
- apr_get_local_port(&port,s);
+ apr_get_port(&port, APR_LOCAL, s);
apr_get_local_ipaddr(&ipaddr,s);
apr_snprintf(addr, sizeof(addr), "address %s port %u", ipaddr,
(unsigned) port);
/* see if we've got an old listener for this address:port */
for (walk = &old_listeners; *walk; walk = &(*walk)->next) {
- apr_get_local_port(&oldport, (*walk)->sd);
+ apr_get_port(&oldport, APR_LOCAL, (*walk)->sd);
apr_get_local_ipaddr(&oldaddr,(*walk)->sd);
if (!strcmp(oldaddr, addr) && port == oldport) {
/* re-use existing record */
"make_sock: failed to get a socket for %s", addr);
return;
}
- apr_set_local_port(new->sd, port);
+ apr_set_port(new->sd, APR_LOCAL, port);
apr_set_local_ipaddr(new->sd, addr);
new->next = ap_listeners;
ap_listeners = new;
* addresses from the query socket.
*/
- apr_set_local_port(sock, ANY_PORT);
+ apr_set_port(sock, APR_LOCAL, ANY_PORT);
apr_set_local_ipaddr(sock, local_ip);
if ((status = apr_bind(sock)) != APR_SUCCESS) {
* errors from connect usually imply the remote machine doesn't support
* the service
*/
- apr_set_remote_port(sock, RFC1413_PORT);
+ apr_set_port(sock, APR_REMOTE, RFC1413_PORT);
apr_set_remote_ipaddr(sock, rmt_ip);
if (apr_connect(sock, NULL) != APR_SUCCESS)
return -1;
- apr_get_local_port(&sav_our_port, sock);
- apr_get_remote_port(&sav_rmt_port, sock);
+ apr_get_port(&sav_our_port, APR_LOCAL, sock);
+ apr_get_port(&sav_rmt_port, APR_REMOTE, sock);
/* send the data */
buflen = apr_snprintf(buffer, sizeof(buffer), "%u,%u\r\n", sav_rmt_port,
apr_table_addn(e, "SERVER_ADMIN", s->server_admin); /* Apache */
apr_table_addn(e, "SCRIPT_FILENAME", r->filename); /* Apache */
- apr_get_remote_port(&rport, c->client_socket);
+ apr_get_port(&rport, APR_REMOTE, c->client_socket);
apr_table_addn(e, "REMOTE_PORT", apr_psprintf(r->pool, "%d", rport));
if (r->user) {
name_chain *src;
last_s = NULL;
- apr_get_local_port(&port, r->connection->client_socket);
+ apr_get_port(&port, APR_LOCAL, r->connection->client_socket);
/* Recall that the name_chain is a list of server_addr_recs, some of
* whose ports may not match. Also each server may appear more than
server_rec *last_s;
name_chain *src;
apr_port_t port;
- apr_get_local_port(&port, r->connection->client_socket);
+ apr_get_port(&port, APR_LOCAL, r->connection->client_socket);
/*
* This is in conjunction with the ServerPath code in http_core, so we
{
ipaddr_chain *trav;
apr_port_t port;
- apr_get_local_port(&port, conn->client_socket);
+ apr_get_port(&port, APR_LOCAL, conn->client_socket);
/* scan the hash apr_table_t for an exact match first */
trav = find_ipaddr(&conn->local_addr.sin_addr, port);