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

Created by Alex Rousskov and last modified
Get this branch:
bzr branch lp:~measurement-factory/squid/ftp-native
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:
Merged

Recent revisions

12816. By Alex Rousskov

Fixes and polishing in response to Amos' squid-dev review dated 2014/08/10.

Fixed handling of FTP commands terminated with LF instead of CRLF (regression
introduced during migration to Tokenizer in r12812).

Many polishing touches.

12815. By Alex Rousskov

Changes in response to Amos' squid-dev review dated 2014/08/08.

See inner commit messages for details.

12814. By Alex Rousskov

SourceFormat Enforcement

12813. By Alex Rousskov

Fixed HttpHdr::Private/NoCache(v) implementations and optimized their API.

These calls now avoid assertions and extra trailing commas when called with
empty names. The API now allows calling with a String() object, but still
needs more polishing work.

Moved common code from Ftp::Server::setReply and Ftp::Relay::createHttpReply()
into Ftp::HttpReplyWrapper().

Also removed the last non-job callbak from Ftp::Client, polished and synced
new FTP comments with the modern client/server/gateway/relay terminology, as
well as minimized changes compared to trunk.

12812. By Alex Rousskov

Converted some of the new FTP code to use SBuf and Tokenizer
instead of MemBuf, String, and c-string manipulations.

12811. By Alex Rousskov

Tokenizer fixes and API improvements.

Taught Tokenizer to keep track of the number of parsed bytes. Many callers
need to know that because they need to adjust/consume I/O offsets/buffers.

Adjusted unused Parser::Tokenizer::token() to not treat NUL delimiter
specially. Besides the fact that not all grammars can treat NUL that way, the
special NUL treatment resulted in some token() calls returning true for empty
tokens, which was confusing parsers. Callers that do not require trailing
delimiters, should use prefix() instead. This change is based on experience
writing Tokenizer-based FTP parser, although the final parser code uses
prefix() instead of token(), for unrelated reasons.

Split Parser::Tokenizer::skip(set) into skipOne() and skipAll(). All other
skip() methods skip exactly one thing (either a given character or a given
token) but the old skip(set) method was skipping multiple things. That
confused callers. We now force the caller to make a choice.

Fixed Parser::Tokenizer::skip(char) to avoid out of bound access.

12810. By Alex Rousskov

Added CharacterSet::complement() to create "all except those in that set" sets
handy for parsing (e.g., "get all characters until the end of line").

Added CharacterSet::rename() to label sets. Handy in const declarations that
use expressions. For example: const CharacterSet AB = (A+B).renamed("AB").

12809. By Alex Rousskov

Do not allow SBuf::toLower/toUpper() return a value.

Some callers think toLower() method changes the string and some think it
returns a changed value without changing the string. Without unportable hacks
like __attribute__((warn_unused_result)), some of the callers will guess wrong
and not know about it. It is easier/safer to change the object itself and
return nothing.

Provided ToUpper/ToLower() functions (not methods!) that preserve their
paramter and return a new object for callers that need the old functionality.
These functions are a good candidate for __attribute__ hacks.

12808. By Alex Rousskov

Polished for the official review, addressing several TODOs.

Use 1.1 version for FTP ports because FTP commands are sent on a
"persistent by default" connection, just like HTTP/1.1.

Cleaned up Ftp::CtrlChannel, Ftp::DataChannel, and Ftp::Client object
construction and destruction.

Do not insist on USER command when intercepting FTP. Interception support
may still not work for other reasons, but USER does not seem to be required
since Squid gets request destination from the intercepted connection info.

12807. By Alex Rousskov

Done moving FTP code around. Polished moved code to match new locations.

src/clients/FtpNative is now src/clients/FtpRelay. It was awkward to use a
non-noun "Native" as a class name, and the class was already described as
"relaying FTP".

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.