]> git.ipfire.org Git - thirdparty/squid.git/commit
assertion failed: Write.cc:41: "!ccb->active()"
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Tue, 15 Mar 2016 12:43:09 +0000 (14:43 +0200)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Tue, 15 Mar 2016 12:43:09 +0000 (14:43 +0200)
commit3238b9b66f062e9b7ef3bb7387d8276db1b0576b
tree996fb223b9dc170845595db265fcc269623934cd
parent0638f4a20a68750298697b587b5a69d660fa57e3
assertion failed: Write.cc:41: "!ccb->active()"

Bug description:
   - The client side and server side are finished
   - On server side the Ftp::Relay::finalizeDataDownload() is called and
     schedules the Ftp::Server::originDataCompletionCheckpoint
   - On client side the "Ftp::Server::userDataCompletionCheckpoint" is
     called. This is schedules a write to control connection and closes
     data connection.
   - The Ftp::Server::originDataCompletionCheckpoint is called which is
     trying to write to control connection and the assertion triggered.

This bug is an corner case, where the client-side  (FTP::Server) should
wait for the server side (Ftp::Client/Ftp::Relay) to finish its job before
respond to the FTP client. In this bug the existing mechanism, designed
to handle such problems, did not worked correctly and resulted to a double
write response to the client.

This patch try to fix the existing mechanism as follows:

- When Ftp::Server receives a "startWaitingForOrigin" callback, postpones
  writting possible responses to the client and keeps waiting for the
  stopWaitingForOrigin callback

- When the Ftp::Server receives a "stopWaitingForOrigin" callback,
  resumes any postponed response.

- When the Ftp::Client starts working on a DATA-related transaction, calls the
  Ftp::Server::startWaitingForOrigin callback

- When the Ftp::Client finishes its job or when its abort abnormaly, checks
  whether it needs to call Ftp::Server::stopWaitingForOrigin callback.

- Also this patch try to fix the status code returned to the FTP client
  taking in account the status code returned by FTP server. The
  "Ftp::Server::stopWaitingForOrigin" is used to pass the returned status code
  to the client side.

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