]> git.ipfire.org Git - thirdparty/squid.git/commit
Fix for : assertion failed: forward.cc:99: "err"
authorwessels <>
Sat, 6 May 2006 03:33:56 +0000 (03:33 +0000)
committerwessels <>
Sat, 6 May 2006 03:33:56 +0000 (03:33 +0000)
commitb2d22df64d7e307b68afa3bc3adca70bf202b0b3
treed30f281cdf244b5cd4a527d999585aad5ec3cd4a
parent0b77ecd840218e12699ef1712ce69c7b67a3f051
Fix for : assertion failed: forward.cc:99: "err"

This assertion was triggered when FwdState tries to re-forward a
request.  The first request fails, but can be retried.  If the first
ServerState gets destroyed before the second ServerState gets
created, the FwdState refcount goes to zero.   The FwdState destructor
has the above assertion because it expects an ErrorState for the
StoreEntry with no content.

This condition can easily happen because the second ServerState
isn't created until the origin server connection is established.
ie:

http.cc(1318) transactionComplete FD -1 this 0x8a430b0
fwdComplete: re-forwarding 504 http://www.example.org/
fwdConnectStart ...
commConnectHandle: ...: COMM_INPROGRESS
httpStateFree: ...
forward.cc(87) FwdState destructor starting
assertion failed: forward.cc:99: "err"

The clientReplyContext class now keeps a refcounted pointer to
FwdState.  This was done so that FwdState refcount doesn't go to
zero during a "reforward" between the time when the initial ServerSide
gets destroyed and before the second attempt ServerSide gets created.

We don't really want to keep FwdState around until the client is
finished.  As an future optimization we can remove the client side
reference around the time when the ENTRY_FWD_HDR_WAIT bit gets
cleared.
src/client_side_reply.cc
src/client_side_reply.h
src/forward.cc
src/forward.h