]> git.ipfire.org Git - thirdparty/squid.git/commit
Bug 3153: Prevent ICAP RESPMOD transactions getting stuck with the adapted body.
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 17 Jun 2011 13:21:15 +0000 (07:21 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 17 Jun 2011 13:21:15 +0000 (07:21 -0600)
commit96bbf0b785eaa607e0ba58b967beabad3261ed53
treee94f22ff6060a0b1d363170116787ea1bf9bc16f
parent972dcb88b04b406d3f2d63f4cd4e56eb43af1b1c
Bug 3153: Prevent ICAP RESPMOD transactions getting stuck with the adapted body.

Part 1.

  Server is expected to receive adapted response headers and then consume the
  adapted response body, if any. If the server receives the headers and then
  aborts, it must notify the ICAP side that nobody will consume the body.
  Otherwise, the ICAP transaction will fill the BodyPipe buffer and get stuck
  waiting for the consumer to free some space.

Part 2:

  This fix still leaves one potential race condition unhandled: The ICAP
  Initiatee disappears right after sending the adapted headers to the Server
  (because there is nothing else for that initiatee to do). After the
  noteAdaptationAnswer() call is scheduled by ICAP and before it is received by
  the Server job, there is no usable link between Server and ICAP.  There is no
  way for the Server to notify the ICAP transaction that the Server job is
  aborting during that time (and there is no Server job at all after it aborts,
  naturally).

  The solutions is to develop a custom AsyncCall which will call the
  expectNoConsumption() on the message pipe if the call cannot be dialed (i.e.,
  the message cannot be delivered to Server).
src/Server.cc
src/adaptation/Initiate.cc