lp:~measurement-factory/squid/ftp-gw

Created by Alex Rousskov and last modified
Get this branch:
bzr branch lp:~measurement-factory/squid/ftp-gw
Members of Measurement Factory can upload to this branch. Log in for directions.

Branch merges

Related bugs

Related blueprints

Branch information

Owner:
Measurement Factory
Project:
Squid
Status:
Development

Recent revisions

12801. By Alex Rousskov

Ignore Range headers with unidentifiable byte-range values.

Same as trunk r13555.

12800. By Alex Rousskov

Do not assert on native FTP ERR_TOO_BIG. Do not check for FTP ERR_TOO_BIG twice.

Inspired by trunk r13535 but restricted to key changes that avoid a
checkHeaderLimits() call for FTP transactions and close the FTP control
connection after writing an early error response.

12799. By Alex Rousskov

Polished to make GCC v4.8 happier.

12798. By Alex Rousskov

Revised ftp-gw timeout handling to cope with very long data downloads/uploads
that triggered bogus ctrl connection timeouts due to ctrl channel inactivity.

Unset ctrl timeout when we are done waiting for the ctrl response
(ServerStateData::readControlReply).

Removed code setting data timeout from Ftp::ServerStateData::dataRead()
because the data timeout is set in ServerStateData::maybeReadVirginBody() that
dataRead calls to read data.

Removed switchTimeoutToDataChannel() from
Ftp::Gateway::ServerStateData::startDataDownload because
  * ctrl timeout should be cleared when we are done waiting for the ctrl
    response (ServerStateData::readControlReply) and
  * data timeout should be set when we start waiting for the data
    (ServerStateData::maybeReadVirginBody)

Unset channel timeout in FtpChannel::forget().

12797. By Christos Tsantilas

FEAT response with excessive whitespace

Some broken Microsoft FTP servers seem to be sending the following
response to the FEAT command:

211-FEAT
....SIZE
....MDTM
211 END

A single dot above represents a single space character, so instead of
one space character they send 4 (four) space characters at the beginning
of the internal FEAT lines.

When this happens, the FTP client who sent the FEAT request to Squid
gets nothing; its connection hangs.

The problem is inside FtpHandleFeatReply function while parses the commands
list. Arguments corresponding to an emty string passes to String::substr call
(e->value.substr(beg-raw, end-raw) call) causing failure to a Must clause.

This patch:
 - fixes and adds checks to avoid processing lines which does not include a
   command.
 - try to detect extra spaces before commands
 - try to add the same number of spaces before commands inserted by squid
   to FEAT commands list (EPSV and EPRT commands)

12796. By Christos Tsantilas

Avoid comm.cc:170: "Comm::IsConnOpen(conn)" assertions
by being more careful with the client data connection state.

Do not forward a 125/150 response to the client until the client data
connection is ready. Do not forward it at all if the data connection was
already closed by the time we got a server 125/150 response. If we have to
wait, we do not really forward the original 125/150 response but generate our
own 150. That may change.

12795. By Alex Rousskov

Removed default FTP port from logged Request URIs on certain errors.

12794. By Christos Tsantilas

Add support for FTP MLSD and MLST commands (RFC 3659)

FileZilla is a popular FTP clients supporting that command (via FEAT detection).
It will use MLSD instead of LIST if the server claims support for MLST and/or
MLSD command.

12793. By Christos Tsantilas

Recognize FTP 125 (Data connection already open) as we do 150 response,
now for the upload/STOR case (the download case was handled in ftp-gw r12789).

Microsoft servers seem to favor 125 responses in some conditions.

12792. By Christos Tsantilas

Urls contain ipv6 ipaddresses may not logged correctly

The urls which include an ipv6 address as hostname does not logged correctly
in the following cases:
 - When a user is already logged in to an ftp server and a
   new USER command entered with ipv6 address as hostname the logged url
   does not put ipv6 address inside brackets ([]).
 - On FTP error responses generated by squid the url which includes ipv6
   addresses apearred with brackets urlencoded. eg:
         ftp://%5B::1%5D/

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
Stacked on:
lp:~squid/squid/trunk
This branch contains Public information 
Everyone can see this information.