]> git.ipfire.org Git - thirdparty/squid.git/commit
FtpServer.cc:1024: "reply != NULL" assertion
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Wed, 19 Aug 2015 10:18:02 +0000 (13:18 +0300)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Wed, 19 Aug 2015 10:18:02 +0000 (13:18 +0300)
commit0d253dfaed93ac3bf31a2fa72d28ca457628fe2d
tree0b4e31b9551138912356d656f23567169ffa7db5
parent4dd2c9d6bd418f800f5ec2fc13ef1245d0fd59f0
FtpServer.cc:1024: "reply != NULL" assertion

Handle nil HttpReply pointer inside various handlers called from
Ftp::Server::handleReply(). For example, when the related StoreEntry
object is aborted, the client_side_reply.cc code may call the
Ftp::Server::handleReply() method with a nil reply pointer.

The Ftp::Server::handleReply() methods itself cannot handle nil replies
because they are valid in many states. Only state-specific handlers know
whether they need the reply.

The Ftp::Server::handleReply() method is called [via Store] from Client code.
Thus, exceptions in handleReply() are handled by the Ftp::Client job. That job
does not have enough information to know whether the client-to-Squid connection
should be closed; the job keeps the connection open. When the reply is nil,
that open connection becomes unusable, leading to more problems.

This patch fixes the Ftp::Server::handleReply() to handle exceptions,
including closing the connections in the case of an exception. It also
adds Must(reply) checks to check for nil HttpReply pointers where the
reply is required. Eventually, Store should start using async calls to
protect jobs waiting for Store updates. Meanwhile, this should help.

This is a Measurement Factory project.
src/servers/FtpServer.cc
src/servers/FtpServer.h