]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/adaptation/icap/Launcher.cc
2 * DEBUG: section 93 ICAP (RFC 3507) Client
6 #include "TextException.h"
8 #include "adaptation/icap/Launcher.h"
9 #include "adaptation/icap/Xaction.h"
10 #include "adaptation/icap/ServiceRep.h"
13 Adaptation::Icap::Launcher::Launcher(const char *aTypeName
,
14 Adaptation::Initiator
*anInitiator
, Adaptation::ServicePointer
&aService
):
16 Adaptation::Initiate(aTypeName
, anInitiator
, aService
),
17 theXaction(0), theLaunches(0)
21 Adaptation::Icap::Launcher::~Launcher()
26 void Adaptation::Icap::Launcher::start()
28 Adaptation::Initiate::start();
34 void Adaptation::Icap::Launcher::launchXaction(bool final
)
38 debugs(93,4, HERE
<< "launching xaction #" << theLaunches
);
39 Adaptation::Icap::Xaction
*x
= createXaction();
42 theXaction
= initiateAdaptation(x
);
46 void Adaptation::Icap::Launcher::noteAdaptationAnswer(HttpMsg
*message
)
49 clearAdaptation(theXaction
);
51 debugs(93,3, HERE
<< "Adaptation::Icap::Launcher::noteAdaptationAnswer exiting ");
54 void Adaptation::Icap::Launcher::noteInitiatorAborted()
57 announceInitiatorAbort(theXaction
); // propogate to the transaction
59 Must(done()); // should be nothing else to do
63 void Adaptation::Icap::Launcher::noteAdaptationQueryAbort(bool final
)
65 clearAdaptation(theXaction
);
67 // TODO: add more checks from FwdState::checkRetry()?
68 if (!final
&& theLaunches
< 2 && !shutting_down
) {
71 debugs(93,3, HERE
<< "cannot retry the failed ICAP xaction; tries: " <<
72 theLaunches
<< "; final: " << final
);
73 Must(done()); // swanSong will notify the initiator
78 bool Adaptation::Icap::Launcher::doneAll() const
80 return (!theInitiator
|| !theXaction
) && Adaptation::Initiate::doneAll();
83 void Adaptation::Icap::Launcher::swanSong()
86 tellQueryAborted(!service().cfg().bypass
);
89 clearAdaptation(theXaction
);
91 Adaptation::Initiate::swanSong();