Re: [SQU] FTP proxy

From: Henrik Nordstrom <[email protected]>
Date: Wed, 23 Aug 2000 10:01:27 +0200

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 - 02:26:56 MDT

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