Re: ftpget and ftp://host:port/ URLs.

From: John Saunders <john@dont-contact.us>
Date: 12 Feb 1997 13:30:10 GMT

Anthony Baxter (arb@connect.com.au) wrote:
>
> ftpget doesn't handle ftp://host:port/ URLs properly. The first page is
> retreived correctly, but the HTML it generates loses the port number from
> the URLs.
>
> (eg ftp://squirl.nightmare.com:9021/pub/python/medusa/ has HTML with anchors
> pointing to ftp://squirl.nightmare.com/pub/python/medusa/.... )

The following seems to work. I don't like the hard coded port 21 though.

--- ftpget.c.orig Thu Feb 13 00:02:44 1997
+++ ftpget.c Thu Feb 13 00:28:19 1997
@@ -2778,6 +2778,8 @@
         strcat(r->url, "@");
     }
     strcat(r->url, r->host);
+ if (r->port != 21)
+ sprintf(&r->url[strlen(r->url)], ":%d", r->port);
     strcat(r->url, "/");
     if (!(r->flags & F_BASEDIR))
         strcat(r->url, r->path);
@@ -2789,6 +2791,8 @@
         strcat(r->title_url, "@");
     }
     strcat(r->title_url, r->host);
+ if (r->port != 21)
+ sprintf(&r->title_url[strlen(r->title_url)], ":%d", r->port);
     strcat(r->title_url, "/");
     if (!(r->flags & F_BASEDIR))
         strcat(r->title_url, r->path);

-- +------------------------------------------------------------+
        . | John Saunders - mailto:john@nlc.net.au (EMail) |
    ,--_|\ | - http://www.nlc.net.au/ (WWW) |
   / Oz \ | - 018-223-814 or 02-9477-2881 (Phone) |
   \_,--\_/ | NHJ NORTHLINK COMMUNICATIONS - Supplying a professional, |
         v | and above all friendly, internet connection service. |
              +------------------------------------------------------------+
Received on Wed Feb 12 1997 - 05:45:30 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:34:25 MST