You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by fi...@apache.org on 2001/05/22 06:08:47 UTC

cvs commit: apr-util/uri apr_uri.c

fielding    01/05/21 21:08:46

  Modified:    include  apr_uri.h
               uri      apr_uri.c
  Log:
  Name protect the default port symbols for each URI scheme.
  Add all of the standardized URL schemes that have default ports.
  
  Revision  Changes    Path
  1.3       +18 -13    apr-util/include/apr_uri.h
  
  Index: apr_uri.h
  ===================================================================
  RCS file: /home/cvs/apr-util/include/apr_uri.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- apr_uri.h	2001/05/22 01:22:03	1.2
  +++ apr_uri.h	2001/05/22 04:08:42	1.3
  @@ -85,19 +85,24 @@
       apr_port_t default_port;
   };
   
  -#define	DEFAULT_FTP_DATA_PORT	20
  -#define	DEFAULT_FTP_PORT	21
  -#define	DEFAULT_GOPHER_PORT	70
  -#ifndef DEFAULT_HTTP_PORT
  -#define	DEFAULT_HTTP_PORT	80
  -#endif
  -#define	DEFAULT_NNTP_PORT	119
  -#define	DEFAULT_WAIS_PORT	210
  -#ifndef DEFAULT_HTTPS_PORT
  -#define	DEFAULT_HTTPS_PORT	443
  -#endif
  -#define	DEFAULT_SNEWS_PORT	563
  -#define	DEFAULT_PROSPERO_PORT	1525	/* WARNING: conflict w/Oracle */
  +#define APU_URI_FTP_DEFAULT_PORT         21
  +#define APU_URI_SSH_DEFAULT_PORT         22
  +#define APU_URI_TELNET_DEFAULT_PORT      23
  +#define APU_URI_GOPHER_DEFAULT_PORT      70
  +#define APU_URI_HTTP_DEFAULT_PORT        80
  +#define APU_URI_POP_DEFAULT_PORT        110
  +#define APU_URI_NNTP_DEFAULT_PORT       119
  +#define APU_URI_IMAP_DEFAULT_PORT       143
  +#define APU_URI_PROSPERO_DEFAULT_PORT   191
  +#define APU_URI_WAIS_DEFAULT_PORT       210
  +#define APU_URI_LDAP_DEFAULT_PORT       389
  +#define APU_URI_HTTPS_DEFAULT_PORT      443
  +#define APU_URI_RTSP_DEFAULT_PORT       554
  +#define APU_URI_SNEWS_DEFAULT_PORT      563
  +#define APU_URI_ACAP_DEFAULT_PORT       674
  +#define APU_URI_NFS_DEFAULT_PORT       2049
  +#define APU_URI_TIP_DEFAULT_PORT       3372
  +#define APU_URI_SIP_DEFAULT_PORT       5060
   
   /* Flags passed to unparse_uri_components(): */
   #define UNP_OMITSITEPART	(1U<<0)	/* suppress "scheme://user@site:port" */
  
  
  
  1.4       +21 -9     apr-util/uri/apr_uri.c
  
  Index: apr_uri.c
  ===================================================================
  RCS file: /home/cvs/apr-util/uri/apr_uri.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- apr_uri.c	2001/05/22 02:48:11	1.3
  +++ apr_uri.c	2001/05/22 04:08:45	1.4
  @@ -74,15 +74,27 @@
   /* they are sorted by their expected frequency */
   static schemes_t schemes[] =
   {
  -    {"http",   DEFAULT_HTTP_PORT},
  -    {"ftp",    DEFAULT_FTP_PORT},
  -    {"https",  DEFAULT_HTTPS_PORT},
  -    {"gopher", DEFAULT_GOPHER_PORT},
  -    {"wais",   DEFAULT_WAIS_PORT},
  -    {"nntp",   DEFAULT_NNTP_PORT},
  -    {"snews",  DEFAULT_SNEWS_PORT},
  -    {"prospero", DEFAULT_PROSPERO_PORT},
  -    { NULL, 0xFFFF }			/* unknown port */
  +    {"http",     APU_URI_HTTP_DEFAULT_PORT},
  +    {"ftp",      APU_URI_FTP_DEFAULT_PORT},
  +    {"https",    APU_URI_HTTPS_DEFAULT_PORT},
  +    {"gopher",   APU_URI_GOPHER_DEFAULT_PORT},
  +    {"ldap",     APU_URI_LDAP_DEFAULT_PORT},
  +    {"nntp",     APU_URI_NNTP_DEFAULT_PORT},
  +    {"snews",    APU_URI_SNEWS_DEFAULT_PORT},
  +    {"imap",     APU_URI_IMAP_DEFAULT_PORT},
  +    {"pop",      APU_URI_POP_DEFAULT_PORT},
  +    {"sip",      APU_URI_SIP_DEFAULT_PORT},
  +    {"rtsp",     APU_URI_RTSP_DEFAULT_PORT},
  +    {"wais",     APU_URI_WAIS_DEFAULT_PORT},
  +    {"z39.50r",  APU_URI_WAIS_DEFAULT_PORT},
  +    {"z39.50s",  APU_URI_WAIS_DEFAULT_PORT},
  +    {"prospero", APU_URI_PROSPERO_DEFAULT_PORT},
  +    {"nfs",      APU_URI_NFS_DEFAULT_PORT},
  +    {"tip",      APU_URI_TIP_DEFAULT_PORT},
  +    {"acap",     APU_URI_ACAP_DEFAULT_PORT},
  +    {"telnet",   APU_URI_TELNET_DEFAULT_PORT},
  +    {"ssh",      APU_URI_SSH_DEFAULT_PORT},
  +    { NULL, 0xFFFF }     /* unknown port */
   };
   
   APU_DECLARE(apr_port_t) apr_uri_default_port_for_scheme(const char *scheme_str)