RE: [SQU] FTP proxy

From: Ian Spare <Ian.Spare@dont-contact.us>
Date: Wed, 23 Aug 2000 11:03:37 +0200

Thanks, that's exactly what I thought. I'd also thought about the peer
selection code as well, it's important to me at least that FTP uses some
peer selection code.

I will try and make use of it just as soon as I unpack all the crates after
moving house:-)

Ian

-----Original Message-----
From: Henrik Nordstrom [mailto:hno@hem.passagen.se]
Sent: Wednesday, August 23, 2000 10:01
To: Ian Spare
Cc: 'squid-users@ircache.net'
Subject: Re: [SQU] FTP proxy

Apparently. Did not know this existed.

You (or anyone else) are welcome to try to make some use of it. How it
should be done is probably by adding the FTP proxy as a cache_peer with
an option to tell squid that it is a FTP proxy, and then make use of
this in peer selection and ftp.
- In struct _peer, add space for the "FTP" option.
- parse_peer, add parsing for the "FTP" cache_peer option to set the
flag in the peer structure (p).
- peerAllowedToBeUsed, deny peers with the FTP option to be used for
anything but ftp
- fwdDispatch, send the request to ftpStart in stead of httpStart if the
selected peer has the FTP option enabled.
- change ftpSendUser to look for ftpState->fwd->servers->peer instead of
that unused proxy_host thing (note that servers might be null).

In total about 10 lines of code that has to be added, spread out as two
lines here and there..

--
Henrik Nordstrom
Squid hacker
Ian Spare wrote:
> 
> In ftp.c I see the following segments:
> 
> typedef struct _Ftpdata {
>     StoreEntry *entry;
>     request_t *request;
>     ......
>     char *proxy_host;
>     .....
> 
> and also:
> 
> static void
> ftpSendUser(FtpStateData * ftpState)
> {
>     if (ftpState->proxy_host != NULL)
>         snprintf(cbuf, 1024, "USER %s@%s\r\n",
>             ftpState->user,
>             ftpState->request->host);
>     else
>         snprintf(cbuf, 1024, "USER %s\r\n", ftpState->user);
>     ftpWriteCommand(cbuf, ftpState);
>     ftpState->state = SENT_USER;
> }
> 
> Which on a quick look seems to be a 'hook' for proxy hosts on FTP although
> it would take some work to get going probably.
--
To unsubscribe, see http://www.squid-cache.org/mailing-lists.html
Received on Wed Aug 23 2000 - 03:06:13 MDT

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