]> sjero.net Git - wget/commitdiff
[svn] Skip `:port' in the host header if it is the DEFAULT_HTTPS_PORT when
authorjanp <devnull@localhost>
Thu, 8 Mar 2001 23:11:03 +0000 (15:11 -0800)
committerjanp <devnull@localhost>
Thu, 8 Mar 2001 23:11:03 +0000 (15:11 -0800)
using SSL. Patch submitted by Hack Kampbjorn <hack@hackdata.com>.

src/ChangeLog
src/http.c
src/url.c
src/url.h

index 46c4f61fbc16c610b18724453cf10c307afd99df..be35c60406a4468765a41795cdb34705399fd4da 100644 (file)
@@ -1,3 +1,13 @@
+2001-03-06  Hack Kampbjorn  <hack@hackdata.com>
+
+       * http.c (gethttp): skip :port in host header if it is the
+       DEFAULT_HTTPS_PORT when using SSL.
+
+       * url.c: move the #define of DEFAULT_HTTP_PORT, DEFAULT_FTP_PORT
+       and DEFAULT_HTTPS_PORT to the header file so it can be use in the
+       rest of the code. 
+       * url.h: Ditto
+
 2001-03-01  Jonas Jensen  <bones@huleboer.dk>
 
        * retr.c (show_progress): Correctly calculate the number of bytes
index 01316292e78e90681a788a9b1d72fa754823d29a..28743bd3e025377ad2a38077c3772a7ab4bf837e 100644 (file)
@@ -617,7 +617,7 @@ gethttp (struct urlinfo *u, struct http_stat *hs, int *dt)
     {
       logprintf (LOG_VERBOSE, _("Connecting to %s:%hu... "), u->host, u->port);
       err = make_connection (&sock, u->host, u->port);
-               switch (err)
+      switch (err)
        {
        case HOSTERR:
          logputs (LOG_VERBOSE, "\n");
@@ -780,7 +780,11 @@ gethttp (struct urlinfo *u, struct http_stat *hs, int *dt)
 
   /* String of the form :PORT.  Used only for non-standard ports. */
   port_maybe = NULL;
-  if (remport != 80)
+#ifdef HAVE_SSL
+  if (remport != (u->proto == URLHTTPS ? DEFAULT_HTTPS_PORT : DEFAULT_HTTP_PORT) )
+#else
+  if (remport != DEFAULT_HTTP_PORT)
+#endif
     {
       port_maybe = (char *)alloca (numdigit (remport) + 2);
       sprintf (port_maybe, ":%d", remport);
index 4c8f35aafe00dc41998d5457ed84ccd44e9af9d4..f29c567a46d27aea3ea2060bac64557f103fe6e0 100644 (file)
--- a/src/url.c
+++ b/src/url.c
@@ -43,11 +43,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 extern int errno;
 #endif
 
-/* Default port definitions */
-#define DEFAULT_HTTP_PORT 80
-#define DEFAULT_FTP_PORT 21
-#define DEFAULT_HTTPS_PORT 443
-
 /* Table of Unsafe chars.  This is intialized in
    init_unsafe_char_table.  */
 
index bfe78426a688791ff1e5d049719fe824f601f001..e53cf2d764d2a026d3095d529c7b04b79c685262 100644 (file)
--- a/src/url.h
+++ b/src/url.h
@@ -20,6 +20,12 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #ifndef URL_H
 #define URL_H
 
+/* Default port definitions */
+#define DEFAULT_HTTP_PORT 80
+#define DEFAULT_FTP_PORT 21
+#define DEFAULT_HTTPS_PORT 443
+
+
 /* If the string contains unsafe characters, duplicate it with
    encode_string, otherwise just copy it with strdup.  */
 #define CLEANDUP(x) (contains_unsafe (x) ? encode_string (x) : xstrdup (x))