]> granicus.if.org Git - apache/commitdiff
Start of moving to apr_port_t in the server code. This will probably the first
authorDavid Reid <dreid@apache.org>
Wed, 8 Nov 2000 11:35:38 +0000 (11:35 +0000)
committerDavid Reid <dreid@apache.org>
Wed, 8 Nov 2000 11:35:38 +0000 (11:35 +0000)
of a few...

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86866 13f79535-47bb-0310-9956-ffa450edef68

include/http_protocol.h
include/httpd.h
include/util_uri.h
modules/http/http_core.c
server/listen.c
server/rfc1413.c
server/util.c
server/util_script.c
server/util_uri.c
server/vhost.c

index 112ca0d13f3e4fc9368e0ad03c12e26960fbf3b3..b56c8225e7695bb07b4299350c271206f807df4b 100644 (file)
@@ -552,9 +552,9 @@ AP_DECLARE_HOOK(const char *,http_method,(const request_rec *))
  * Return the default port from the current request
  * @param r The current request
  * @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
 }
index 76a0ea3ca914387a0f8823931def3683f35a2134..6aa52234e6441a6db49120d1112631f69aca039e 100644 (file)
@@ -904,7 +904,7 @@ struct server_addr_rec {
     /** The bound address, for this server */
     apr_in_addr host_addr;
     /** The bound port, for this server */
-    unsigned short host_port;
+    apr_port_t host_port;
     /** The name given in <VirtualHost> */
     char *virthost;
 };
@@ -928,7 +928,7 @@ struct server_rec {
     /** The server hostname */
     char *server_hostname;
     /** for redirects, etc. */
-    unsigned short port;
+    apr_port_t port;
 
     /* 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 r The current request
  * @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,
-                                   unsigned port, const request_rec *r);
+                                   apr_port_t port, const request_rec *r);
 /**
  * Escape a shell command
  * @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 port The port found in the hostname
  * @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...
index a67ead165cd0bf23ae89021b8316b6b9dfa1d2bc..fc785fd8e8038058dcd4f4b87fd00b5d02838063 100644 (file)
@@ -78,7 +78,7 @@ struct schemes_t {
     /** The name of the scheme */
     const char *name;
     /** The default port for the scheme */
-    unsigned short default_port;
+    apr_port_t default_port;
 };
 
 #define        DEFAULT_FTP_DATA_PORT   20
@@ -128,7 +128,7 @@ struct uri_components {
     struct hostent *hostent;
 
     /** The port number, numeric, valid only if port_str != NULL */
-    unsigned short port;
+    apr_port_t port;
     
     /** has the structure been initialized */
     unsigned is_initialized:1;
@@ -145,17 +145,17 @@ struct uri_components {
  * http, ftp, https, gopher, wais, nntp, snews, and prospero
  * @param scheme_str The string that contains the current 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
  * @param r The current request
  * @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
index 7c359f84fc871c685d440baa1185bcd5463c5604..74e2a94a1bd9020147b0fc7978bd9bc980860df3 100644 (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)
 {
-    unsigned port;
+    apr_port_t port;
     core_dir_config *d =
       (core_dir_config *)ap_get_module_config(r->per_dir_config, &core_module);
     
index fb9edd7455a8c771e404b794ba58249db92d8071..997a2e0eb885f3ca983a0458ac249de901eed104 100644 (file)
@@ -83,7 +83,7 @@ static apr_status_t make_sock(apr_pool_t *p, ap_listen_rec *server)
     int one = 1;
     char addr[512];
     apr_status_t stat;
-    apr_uint32_t port;
+    apr_port_t port;
     char *ipaddr;
 
     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;
     apr_status_t status;
     char *oldaddr;
-    unsigned int oldport;
+    apr_port_t oldport;
 
     /* see if we've got an old listener for this address:port */
     for (walk = &old_listeners; *walk; walk = &(*walk)->next) {
index 100870572392e96d92ebe18cf4c7f2f6437c5665..9535d9eb0df479b2ad94e118f0d356f1268f87ab 100644 (file)
@@ -112,8 +112,8 @@ static int get_rfc1413(apr_socket_t *sock, const char *local_ip,
                       const char *rmt_ip, 
                       char user[RFC1413_USERLEN+1], server_rec *srv)
 {
-    unsigned int rmt_port, our_port;
-    unsigned int sav_rmt_port, sav_our_port;
+    apr_port_t rmt_port, our_port;
+    apr_port_t sav_rmt_port, sav_our_port;
     apr_status_t status;
     int i;
     char *cp;
index 3eccf5ed9dc2fd114230f9758234b1997d882ffd..ab5afea3bb2cf8ebf8705af1fb5de3a1a641f6b0 100644 (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,
-                                   unsigned port, const request_rec *r)
+                                   apr_port_t port, const request_rec *r)
 {
     if (ap_is_default_port(port, r))
        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]
  * :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;
     unsigned long my_addr;
index 397340fa309f30adfd270e56914be5285a6fa759..4eb861742fcdab9a985618cf5c5e28b16a20ca1f 100644 (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_table_entry_t *hdrs = (apr_table_entry_t *) hdrs_arr->elts;
     int i;
-    apr_uint32_t rport;
+    apr_port_t rport;
 
     /* use a temporary apr_table_t which we'll overlap onto
      * r->subprocess_env later
index 71d62dc9d8206a672016333288f2c22bcbbbc508..fa4293df59bc387559d52587ad701ed21f9750e0 100644 (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;
 
@@ -105,7 +105,7 @@ AP_DECLARE(unsigned short) ap_default_port_for_scheme(const char *scheme_str)
     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)
        ? ap_default_port_for_scheme(r->parsed_uri.scheme)
index b1601a0147abb3bc13af72264a11daaeccecee11..ede5b96f565b664ac9aa5440cf62823dc7582ed3 100644 (file)
@@ -854,7 +854,7 @@ static void check_hostalias(request_rec *r)
      *   names we'll match have ports associated with them
      */
     const char *host = r->hostname;
-    unsigned port;
+    apr_port_t port;
     server_rec *s;
     server_rec *last_s;
     name_chain *src;
@@ -914,7 +914,7 @@ static void check_serverpath(request_rec *r)
     server_rec *s;
     server_rec *last_s;
     name_chain *src;
-    unsigned port;
+    apr_port_t port;
     apr_get_local_port(&port, r->connection->client_socket);
    
     /*