From: hno <> Date: Wed, 3 May 2000 02:20:10 +0000 (+0000) Subject: hno squid-2.3.DEVEL3.ftp_HEAD.patch X-Git-Tag: SQUID_3_0_PRE1~2013 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7497ceef075ac1b60c98b901e0e41c2b7ef73dda;p=thirdparty%2Fsquid.git hno squid-2.3.DEVEL3.ftp_HEAD.patch Squid-2.3.DEVEL3: HEAD and ftp://... Support HEAD ftp://.. requests without fetching the whole object. --- diff --git a/ChangeLog b/ChangeLog index c3c62597ae..f5e765de0d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -40,6 +40,7 @@ Changes to Squid-2.4.DEVEL3 (): - Helpers are now restarted when the logs are rotated - Negatively cached DNS entries are now purged on "reload". - PURGE now also purges the DNS cache + - HEAD on FTP objects no longer retreives the whole object Changes to Squid-2.4.DEVEL2 (): diff --git a/src/ftp.cc b/src/ftp.cc index df6db959f9..7994319196 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -1,6 +1,6 @@ /* - * $Id: ftp.cc,v 1.289 2000/03/06 16:23:31 wessels Exp $ + * $Id: ftp.cc,v 1.290 2000/05/02 20:20:10 hno Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -1645,6 +1645,14 @@ ftpSendPasv(FtpStateData * ftpState) int fd; struct sockaddr_in addr; socklen_t addr_len; + if (ftpState->request->method == METHOD_HEAD) { + /* Terminate here for HEAD requests */ + ftpAppendSuccessHeader(ftpState); + storeTimestampsSet(ftpState->entry); + fwdComplete(ftpState->fwd); + ftpSendQuit(ftpState); + return; + } if (ftpState->data.fd >= 0) { if (!ftpState->flags.datachannel_hack) { /* We are already connected, reuse this connection. */