using SSL. Patch submitted by Hack Kampbjorn <hack@hackdata.com>.
+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
{
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");
/* 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);
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. */
#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))