1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-30 15:01:14 +03:00

Start of moving to apr_port_t in the server code. This will probably the first

of a few...


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86866 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
David Reid
2000-11-08 11:35:38 +00:00
parent 2b00b3a71c
commit 33aabfee3f
10 changed files with 26 additions and 26 deletions

View File

@@ -552,9 +552,9 @@ AP_DECLARE_HOOK(const char *,http_method,(const request_rec *))
* Return the default port from the current request * Return the default port from the current request
* @param r The current request * @param r The current request
* @return The current port * @return The current port
* @deffunc unsigned short ap_run_default_port(const request_rec *r) * @deffunc apr_port_t ap_run_default_port(const request_rec *r)
*/ */
AP_DECLARE_HOOK(unsigned short,default_port,(const request_rec *)) AP_DECLARE_HOOK(apr_port_t,default_port,(const request_rec *))
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@@ -904,7 +904,7 @@ struct server_addr_rec {
/** The bound address, for this server */ /** The bound address, for this server */
apr_in_addr host_addr; apr_in_addr host_addr;
/** The bound port, for this server */ /** The bound port, for this server */
unsigned short host_port; apr_port_t host_port;
/** The name given in <VirtualHost> */ /** The name given in <VirtualHost> */
char *virthost; char *virthost;
}; };
@@ -928,7 +928,7 @@ struct server_rec {
/** The server hostname */ /** The server hostname */
char *server_hostname; char *server_hostname;
/** for redirects, etc. */ /** for redirects, etc. */
unsigned short port; apr_port_t port;
/* Log files --- note that transfer log is now in the modules... */ /* Log files --- note that transfer log is now in the modules... */
@@ -1277,10 +1277,10 @@ AP_DECLARE(char *) ap_escape_html(apr_pool_t *p, const char *s);
* @param port The port the server is running on * @param port The port the server is running on
* @param r The current request * @param r The current request
* @return The server's hostname * @return The server's hostname
* @deffunc char *ap_construct_server(apr_pool_t *p, const char *hostname, unsiged port, const request_rec *r) * @deffunc char *ap_construct_server(apr_pool_t *p, const char *hostname, apr_port_t port, const request_rec *r)
*/ */
AP_DECLARE(char *) ap_construct_server(apr_pool_t *p, const char *hostname, AP_DECLARE(char *) ap_construct_server(apr_pool_t *p, const char *hostname,
unsigned port, const request_rec *r); apr_port_t port, const request_rec *r);
/** /**
* Escape a shell command * Escape a shell command
* @param p The pool to allocate out of * @param p The pool to allocate out of
@@ -1569,9 +1569,9 @@ char *ap_get_local_host(apr_pool_t *p);
* @param hostname The hostname to parse * @param hostname The hostname to parse
* @param port The port found in the hostname * @param port The port found in the hostname
* @return The address of the server * @return The address of the server
* @deffunc unsigned long ap_get_virthost_addr(char *hostname, unsigned shor *port) * @deffunc unsigned long ap_get_virthost_addr(char *hostname, apr_port_t *port)
*/ */
unsigned long ap_get_virthost_addr(char *hostname, unsigned short *port); unsigned long ap_get_virthost_addr(char *hostname, apr_port_t *port);
/* /*
* Redefine assert() to something more useful for an Apache... * Redefine assert() to something more useful for an Apache...

View File

@@ -78,7 +78,7 @@ struct schemes_t {
/** The name of the scheme */ /** The name of the scheme */
const char *name; const char *name;
/** The default port for the scheme */ /** The default port for the scheme */
unsigned short default_port; apr_port_t default_port;
}; };
#define DEFAULT_FTP_DATA_PORT 20 #define DEFAULT_FTP_DATA_PORT 20
@@ -128,7 +128,7 @@ struct uri_components {
struct hostent *hostent; struct hostent *hostent;
/** The port number, numeric, valid only if port_str != NULL */ /** The port number, numeric, valid only if port_str != NULL */
unsigned short port; apr_port_t port;
/** has the structure been initialized */ /** has the structure been initialized */
unsigned is_initialized:1; unsigned is_initialized:1;
@@ -145,17 +145,17 @@ struct uri_components {
* http, ftp, https, gopher, wais, nntp, snews, and prospero * http, ftp, https, gopher, wais, nntp, snews, and prospero
* @param scheme_str The string that contains the current scheme * @param scheme_str The string that contains the current scheme
* @return The default port for this scheme * @return The default port for this scheme
* @deffunc unsigned short ap_default_port_for_scheme(const char *scheme_str) * @deffunc apr_port_t ap_default_port_for_scheme(const char *scheme_str)
*/ */
AP_DECLARE(unsigned short) ap_default_port_for_scheme(const char *scheme_str); AP_DECLARE(apr_port_t) ap_default_port_for_scheme(const char *scheme_str);
/** /**
* Return the default for the current request * Return the default for the current request
* @param r The current request * @param r The current request
* @return The default port * @return The default port
* @deffunc unsigned short ap_default_port_for_request(const request_rec *r) * @deffunc apr_port_t ap_default_port_for_request(const request_rec *r)
*/ */
AP_DECLARE(unsigned short) ap_default_port_for_request(const request_rec *r); AP_DECLARE(apr_port_t) ap_default_port_for_request(const request_rec *r);
/** /**
* Create a copy of a "struct hostent" record; it was presumably returned * Create a copy of a "struct hostent" record; it was presumably returned

View File

@@ -766,7 +766,7 @@ AP_DECLARE(const char *) ap_get_server_name(request_rec *r)
AP_DECLARE(unsigned) ap_get_server_port(const request_rec *r) AP_DECLARE(unsigned) ap_get_server_port(const request_rec *r)
{ {
unsigned port; apr_port_t port;
core_dir_config *d = core_dir_config *d =
(core_dir_config *)ap_get_module_config(r->per_dir_config, &core_module); (core_dir_config *)ap_get_module_config(r->per_dir_config, &core_module);

View File

@@ -83,7 +83,7 @@ static apr_status_t make_sock(apr_pool_t *p, ap_listen_rec *server)
int one = 1; int one = 1;
char addr[512]; char addr[512];
apr_status_t stat; apr_status_t stat;
apr_uint32_t port; apr_port_t port;
char *ipaddr; char *ipaddr;
apr_get_local_port(&port,s); apr_get_local_port(&port,s);
@@ -178,7 +178,7 @@ static void alloc_listener(process_rec *process, char *addr, unsigned int port)
ap_listen_rec *new; ap_listen_rec *new;
apr_status_t status; apr_status_t status;
char *oldaddr; char *oldaddr;
unsigned int oldport; apr_port_t oldport;
/* see if we've got an old listener for this address:port */ /* see if we've got an old listener for this address:port */
for (walk = &old_listeners; *walk; walk = &(*walk)->next) { for (walk = &old_listeners; *walk; walk = &(*walk)->next) {

View File

@@ -112,8 +112,8 @@ static int get_rfc1413(apr_socket_t *sock, const char *local_ip,
const char *rmt_ip, const char *rmt_ip,
char user[RFC1413_USERLEN+1], server_rec *srv) char user[RFC1413_USERLEN+1], server_rec *srv)
{ {
unsigned int rmt_port, our_port; apr_port_t rmt_port, our_port;
unsigned int sav_rmt_port, sav_our_port; apr_port_t sav_rmt_port, sav_our_port;
apr_status_t status; apr_status_t status;
int i; int i;
char *cp; char *cp;

View File

@@ -1557,7 +1557,7 @@ AP_DECLARE(int) ap_unescape_url(char *url)
} }
AP_DECLARE(char *) ap_construct_server(apr_pool_t *p, const char *hostname, AP_DECLARE(char *) ap_construct_server(apr_pool_t *p, const char *hostname,
unsigned port, const request_rec *r) apr_port_t port, const request_rec *r)
{ {
if (ap_is_default_port(port, r)) if (ap_is_default_port(port, r))
return apr_pstrdup(p, hostname); return apr_pstrdup(p, hostname);
@@ -1846,7 +1846,7 @@ AP_DECLARE(gid_t) ap_gname2id(const char *name)
* Parses a host of the form <address>[:port] * Parses a host of the form <address>[:port]
* :port is permitted if 'port' is not NULL * :port is permitted if 'port' is not NULL
*/ */
unsigned long ap_get_virthost_addr(char *w, unsigned short *ports) unsigned long ap_get_virthost_addr(char *w, apr_port_t *ports)
{ {
struct hostent *hep; struct hostent *hep;
unsigned long my_addr; unsigned long my_addr;

View File

@@ -166,7 +166,7 @@ AP_DECLARE(void) ap_add_common_vars(request_rec *r)
apr_array_header_t *hdrs_arr = apr_table_elts(r->headers_in); apr_array_header_t *hdrs_arr = apr_table_elts(r->headers_in);
apr_table_entry_t *hdrs = (apr_table_entry_t *) hdrs_arr->elts; apr_table_entry_t *hdrs = (apr_table_entry_t *) hdrs_arr->elts;
int i; int i;
apr_uint32_t rport; apr_port_t rport;
/* use a temporary apr_table_t which we'll overlap onto /* use a temporary apr_table_t which we'll overlap onto
* r->subprocess_env later * r->subprocess_env later

View File

@@ -94,7 +94,7 @@ static schemes_t schemes[] =
}; };
AP_DECLARE(unsigned short) ap_default_port_for_scheme(const char *scheme_str) AP_DECLARE(apr_port_t) ap_default_port_for_scheme(const char *scheme_str)
{ {
schemes_t *scheme; schemes_t *scheme;
@@ -105,7 +105,7 @@ AP_DECLARE(unsigned short) ap_default_port_for_scheme(const char *scheme_str)
return 0; return 0;
} }
AP_DECLARE(unsigned short) ap_default_port_for_request(const request_rec *r) AP_DECLARE(apr_port_t) ap_default_port_for_request(const request_rec *r)
{ {
return (r->parsed_uri.scheme) return (r->parsed_uri.scheme)
? ap_default_port_for_scheme(r->parsed_uri.scheme) ? ap_default_port_for_scheme(r->parsed_uri.scheme)

View File

@@ -854,7 +854,7 @@ static void check_hostalias(request_rec *r)
* names we'll match have ports associated with them * names we'll match have ports associated with them
*/ */
const char *host = r->hostname; const char *host = r->hostname;
unsigned port; apr_port_t port;
server_rec *s; server_rec *s;
server_rec *last_s; server_rec *last_s;
name_chain *src; name_chain *src;
@@ -914,7 +914,7 @@ static void check_serverpath(request_rec *r)
server_rec *s; server_rec *s;
server_rec *last_s; server_rec *last_s;
name_chain *src; name_chain *src;
unsigned port; apr_port_t port;
apr_get_local_port(&port, r->connection->client_socket); apr_get_local_port(&port, r->connection->client_socket);
/* /*