/* for CBDATA_CLASS() */
#include "cbdata.h"
-#if ICAP_CLIENT
-#include "ICAP/ICAPServiceRep.h"
+#if USE_ADAPTATION
+#include "adaptation/forward.h"
#endif
class ClientRequestContext : public RefCountable
void clientRedirectDone(char *result);
void checkNoCache();
void checkNoCacheDone(int answer);
-#if ICAP_CLIENT
+#if USE_ADAPTATION
- void icapAccessCheck();
- void icapAclCheckDone(ICAPServiceRep::Pointer service);
+ void adaptationAccessCheck();
+ void adaptationAclCheckDone(Adaptation::ServicePointer service);
#endif
ClientHttpRequest *http;
int redirect_state;
bool http_access_done;
-#if ICAP_CLIENT
+#if USE_ADAPTATION
- bool icap_acl_check_done;
+ bool adaptation_acl_check_done;
#endif
bool redirect_done;
#include "HttpReply.h"
#include "errorpage.h"
-#if ICAP_CLIENT
-#include "ICAP/ICAPModXact.h"
+#if USE_ADAPTATION
+#include "adaptation/Service.h"
#include "ICAP/ICAPConfig.h"
extern ICAPConfig TheICAPConfig;
#endif
ServerStateData::ServerStateData(FwdState *theFwdState): AsyncJob("ServerStateData"),requestSender(NULL)
-#if ICAP_CLIENT
+#if USE_ADAPTATION
, adaptedHeadSource(NULL)
- , icapAccessCheckPending(false)
- , startedIcap(false)
+ , adaptationAccessCheckPending(false)
+ , startedAdaptation(false)
#endif
{
fwd = theFwdState;
if (requestBodySource != NULL)
requestBodySource->clearConsumer();
-#if ICAP_CLIENT
- cleanIcap();
+#if USE_ADAPTATION
+ cleanAdaptation();
#endif
if (responseBodyBuffer != NULL) {
{
debugs(11,5,HERE << "serverComplete2 " << this);
-#if ICAP_CLIENT
+#if USE_ADAPTATION
if (virginBodyDestination != NULL)
stopProducingFor(virginBodyDestination, true);
- if (!doneWithIcap())
+ if (!doneWithAdaptation())
return;
#endif
// to the ICAP service. And vice versa. Here, we quit only if we are done
// talking to both.
void ServerStateData::quitIfAllDone() {
-#if ICAP_CLIENT
- if (!doneWithIcap()) {
+#if USE_ADAPTATION
+ if (!doneWithAdaptation()) {
debugs(11,5, HERE << "transaction not done: still talking to ICAP");
return;
}
void
ServerStateData::noteMoreBodyDataAvailable(BodyPipe::Pointer bp)
{
-#if ICAP_CLIENT
+#if USE_ADAPTATION
if (adaptedBodySource == bp) {
handleMoreAdaptedBodyAvailable();
return;
void
ServerStateData::noteBodyProductionEnded(BodyPipe::Pointer bp)
{
-#if ICAP_CLIENT
+#if USE_ADAPTATION
if (adaptedBodySource == bp) {
handleAdaptedBodyProductionEnded();
return;
void
ServerStateData::noteBodyProducerAborted(BodyPipe::Pointer bp)
{
-#if ICAP_CLIENT
+#if USE_ADAPTATION
if (adaptedBodySource == bp) {
handleAdaptedBodyProducerAborted();
return;
}
}
-// called by noteIcapAnswer(), HTTP server overwrites this
+// called by noteAdaptationAnswer(), HTTP server overwrites this
void
ServerStateData::haveParsedReplyHeaders()
{
return request;
}
-#if ICAP_CLIENT
+#if USE_ADAPTATION
/*
* Initiate an ICAP transaction. Return true on success.
* Caller will handle error condition by generating a Squid error message
* or take other action.
*/
bool
-ServerStateData::startIcap(ICAPServiceRep::Pointer service, HttpRequest *cause)
+ServerStateData::startAdaptation(Adaptation::ServicePointer service, HttpRequest *cause)
{
- debugs(11, 5, "ServerStateData::startIcap() called");
+ debugs(11, 5, "ServerStateData::startAdaptation() called");
if (!service) {
- debugs(11, 3, "ServerStateData::startIcap fails: lack of service");
+ debugs(11, 3, "ServerStateData::startAdaptation fails: lack of service");
return false;
}
if (service->broken()) {
- debugs(11, 3, "ServerStateData::startIcap fails: broken service");
+ debugs(11, 3, "ServerStateData::startAdaptation fails: broken service");
return false;
}
virginBodyDestination->setBodySize(size);
}
- adaptedHeadSource = initiateIcap(
- new ICAPModXactLauncher(this, vrep, cause, service));
+ adaptedHeadSource = initiateAdaptation(service->makeXactLauncher(
+ this, vrep, cause));
return adaptedHeadSource != NULL;
}
// properly cleans up ICAP-related state
// may be called multiple times
-void ServerStateData::cleanIcap() {
- debugs(11,5, HERE << "cleaning ICAP; ACL: " << icapAccessCheckPending);
+void ServerStateData::cleanAdaptation() {
+ debugs(11,5, HERE << "cleaning ICAP; ACL: " << adaptationAccessCheckPending);
if (virginBodyDestination != NULL)
stopProducingFor(virginBodyDestination, false);
if (adaptedBodySource != NULL)
stopConsumingFrom(adaptedBodySource);
- if (!icapAccessCheckPending) // we cannot cancel a pending callback
- assert(doneWithIcap()); // make sure the two methods are in sync
+ if (!adaptationAccessCheckPending) // we cannot cancel a pending callback
+ assert(doneWithAdaptation()); // make sure the two methods are in sync
}
bool
-ServerStateData::doneWithIcap() const {
- return !icapAccessCheckPending &&
+ServerStateData::doneWithAdaptation() const {
+ return !adaptationAccessCheckPending &&
!virginBodyDestination && !adaptedHeadSource && !adaptedBodySource;
}
void
ServerStateData::adaptVirginReplyBody(const char *data, ssize_t len)
{
- assert(startedIcap);
+ assert(startedAdaptation);
if (!virginBodyDestination) {
debugs(11,3, HERE << "ICAP does not want more virgin body");
{
stopProducingFor(virginBodyDestination, false);
- // do not force closeServer here in case we need to bypass IcapQueryAbort
+ // do not force closeServer here in case we need to bypass AdaptationQueryAbort
- if (doneWithIcap()) // we may still be receiving adapted response
- handleIcapCompleted();
+ if (doneWithAdaptation()) // we may still be receiving adapted response
+ handleAdaptationCompleted();
}
// received adapted response headers (body may follow)
void
-ServerStateData::noteIcapAnswer(HttpMsg *msg)
+ServerStateData::noteAdaptationAnswer(HttpMsg *msg)
{
- clearIcap(adaptedHeadSource); // we do not expect more messages
+ clearAdaptation(adaptedHeadSource); // we do not expect more messages
if (abortOnBadEntry("entry went bad while waiting for adapted headers"))
return;
assert(adaptedBodySource->setConsumerIfNotLate(this));
} else {
// no body
- if (doneWithIcap()) // we may still be sending virgin response
- handleIcapCompleted();
+ if (doneWithAdaptation()) // we may still be sending virgin response
+ handleAdaptationCompleted();
}
}
// will not receive adapted response headers (and, hence, body)
void
-ServerStateData::noteIcapQueryAbort(bool final)
+ServerStateData::noteAdaptationQueryAbort(bool final)
{
- clearIcap(adaptedHeadSource);
- handleIcapAborted(!final);
+ clearAdaptation(adaptedHeadSource);
+ handleAdaptationAborted(!final);
}
// more adapted response body is available
if (abortOnBadEntry("entry went bad while waiting for adapted body eof"))
return;
- handleIcapCompleted();
+ handleAdaptationCompleted();
}
// premature end of the adapted response body
void ServerStateData::handleAdaptedBodyProducerAborted()
{
stopConsumingFrom(adaptedBodySource);
- handleIcapAborted();
+ handleAdaptationAborted();
}
-// common part of noteIcapAnswer and handleAdaptedBodyProductionEnded
+// common part of noteAdaptationAnswer and handleAdaptedBodyProductionEnded
void
-ServerStateData::handleIcapCompleted()
+ServerStateData::handleAdaptationCompleted()
{
- debugs(11,5, HERE << "handleIcapCompleted");
- cleanIcap();
+ debugs(11,5, HERE << "handleAdaptationCompleted");
+ cleanAdaptation();
// We stop reading origin response because we have no place to put it and
// cannot use it. If some origin servers do not like that or if we want to
}
-// common part of noteIcap*Aborted and noteBodyConsumerAborted methods
+// common part of noteAdaptation*Aborted and noteBodyConsumerAborted methods
void
-ServerStateData::handleIcapAborted(bool bypassable)
+ServerStateData::handleAdaptationAborted(bool bypassable)
{
- debugs(11,5, HERE << "handleIcapAborted; bypassable: " << bypassable <<
+ debugs(11,5, HERE << "handleAdaptationAborted; bypassable: " << bypassable <<
", entry empty: " << entry->isEmpty());
if (abortOnBadEntry("entry went bad while ICAP aborted"))
}
void
-ServerStateData::icapAclCheckDone(ICAPServiceRep::Pointer service)
+ServerStateData::adaptationAclCheckDone(Adaptation::ServicePointer service)
{
- icapAccessCheckPending = false;
+ adaptationAccessCheckPending = false;
if (abortOnBadEntry("entry went bad while waiting for ICAP ACL check"))
return;
}
// TODO: Should we check received5CBodyTooLarge on the server-side as well?
- startedIcap = startIcap(service, originalRequest());
+ startedAdaptation = startAdaptation(service, originalRequest());
- if (!startedIcap && (!service || service->bypass)) {
+ if (!startedAdaptation && (!service || service->cfg().bypass)) {
// handle ICAP start failure when no service was selected
// or where the selected service was optional
setFinalReply(virginReply());
return;
}
- if (!startedIcap) {
+ if (!startedAdaptation) {
// handle start failure for an essential ICAP service
ErrorState *err = errorCon(ERR_ICAP_FAILURE,
HTTP_INTERNAL_SERVER_ERROR, originalRequest());
}
void
-ServerStateData::icapAclCheckDoneWrapper(ICAPServiceRep::Pointer service, void *data)
+ServerStateData::adaptationAclCheckDoneWrapper(Adaptation::ServicePointer service, void *data)
{
ServerStateData *state = (ServerStateData *)data;
- state->icapAclCheckDone(service);
+ state->adaptationAclCheckDone(service);
}
#endif
void
ServerStateData::adaptOrFinalizeReply()
{
-#if ICAP_CLIENT
+#if USE_ADAPTATION
if (TheICAPConfig.onoff) {
- ICAPAccessCheck *icap_access_check =
- new ICAPAccessCheck(ICAP::methodRespmod, ICAP::pointPreCache,
- request, virginReply(), icapAclCheckDoneWrapper, this);
+ Adaptation::AccessCheck *check = new Adaptation::AccessCheck(
+ Adaptation::methodRespmod, ICAP::pointPreCache,
+ request, virginReply(), adaptationAclCheckDoneWrapper, this);
- icapAccessCheckPending = true;
- icap_access_check->check(); // will eventually delete self
+ adaptationAccessCheckPending = true;
+ check->check(); // will eventually delete self
return;
}
void
ServerStateData::addVirginReplyBody(const char *data, ssize_t len)
{
-#if ICAP_CLIENT
- assert(!icapAccessCheckPending); // or would need to buffer while waiting
- if (startedIcap) {
+#if USE_ADAPTATION
+ assert(!adaptationAccessCheckPending); // or would need to buffer while waiting
+ if (startedAdaptation) {
adaptVirginReplyBody(data, len);
return;
}
size_t ServerStateData::replyBodySpace(size_t space)
{
-#if ICAP_CLIENT
+#if USE_ADAPTATION
if (responseBodyBuffer) {
return 0; // Stop reading if already overflowed waiting for ICAP to catch up
}
* The BodyPipe will call our noteMoreBodySpaceAvailable() method
* when it has free space again.
*/
- size_t icap_space = virginBodyDestination->buf().potentialSpaceSize();
+ size_t adaptation_space =
+ virginBodyDestination->buf().potentialSpaceSize();
- debugs(11,9, "ServerStateData may read up to min(" << icap_space <<
- ", " << space << ") bytes");
+ debugs(11,9, "ServerStateData may read up to min(" <<
+ adaptation_space << ", " << space << ") bytes");
- if (icap_space < space)
- space = icap_space;
+ if (adaptation_space < space)
+ space = adaptation_space;
}
#endif
#include "ICAP/AsyncJob.h"
#include "CommCalls.h"
-#if ICAP_CLIENT
-#include "ICAP/ICAPServiceRep.h"
-#include "ICAP/ICAPInitiator.h"
-
-class ICAPAccessCheck;
+#if USE_ADAPTATION
+#include "adaptation/forward.h"
+#include "adaptation/Initiator.h"
#endif
class ServerStateData:
-#if ICAP_CLIENT
- public ICAPInitiator,
+#if USE_ADAPTATION
+ public Adaptation::Initiator,
public BodyProducer,
#endif
public BodyConsumer
// a hack to reach HttpStateData::orignal_request
virtual HttpRequest *originalRequest();
-#if ICAP_CLIENT
- void icapAclCheckDone(ICAPServiceRep::Pointer);
- static void icapAclCheckDoneWrapper(ICAPServiceRep::Pointer service, void *data);
+#if USE_ADAPTATION
+ void adaptationAclCheckDone(Adaptation::ServicePointer service);
+ static void adaptationAclCheckDoneWrapper(Adaptation::ServicePointer service, void *data);
// ICAPInitiator: start an ICAP transaction and receive adapted headers.
- virtual void noteIcapAnswer(HttpMsg *message);
- virtual void noteIcapQueryAbort(bool final);
+ virtual void noteAdaptationAnswer(HttpMsg *message);
+ virtual void noteAdaptationQueryAbort(bool final);
// BodyProducer: provide virgin response body to ICAP.
virtual void noteMoreBodySpaceAvailable(BodyPipe::Pointer );
//AsyncJob virtual methods
virtual bool doneAll() const { return
-#if ICAP_CLIENT
- ICAPInitiator::doneAll() &&
+#if USE_ADAPTATION
+ Adaptation::Initiator::doneAll() &&
BodyProducer::doneAll() &&
#endif
BodyConsumer::doneAll() && false;}
// Entry-dependent callbacks use this check to quit if the entry went bad
bool abortOnBadEntry(const char *abortReason);
-#if ICAP_CLIENT
- bool startIcap(ICAPServiceRep::Pointer, HttpRequest *cause);
+#if USE_ADAPTATION
+ bool startAdaptation(Adaptation::ServicePointer service, HttpRequest *cause);
void adaptVirginReplyBody(const char *buf, ssize_t len);
- void cleanIcap();
- virtual bool doneWithIcap() const; // did we end ICAP communication?
+ void cleanAdaptation();
+ virtual bool doneWithAdaptation() const; // did we end ICAP communication?
// BodyConsumer for ICAP: consume adapted response body.
void handleMoreAdaptedBodyAvailable();
void handleAdaptedBodyProductionEnded();
void handleAdaptedBodyProducerAborted();
- void handleIcapCompleted();
- void handleIcapAborted(bool bypassable = false);
+ void handleAdaptationCompleted();
+ void handleAdaptationAborted(bool bypassable = false);
#endif
protected:
BodyPipe::Pointer requestBodySource; // to consume request body
AsyncCall::Pointer requestSender; // set if we are expecting comm_write to call us back
-#if ICAP_CLIENT
+#if USE_ADAPTATION
BodyPipe::Pointer virginBodyDestination; // to provide virgin response body
- ICAPInitiate *adaptedHeadSource; // to get adapted response headers
+ Adaptation::Initiate *adaptedHeadSource; // to get adapted response headers
BodyPipe::Pointer adaptedBodySource; // to consume adated response body
- bool icapAccessCheckPending;
- bool startedIcap;
+ bool adaptationAccessCheckPending;
+ bool startedAdaptation;
#endif
private:
#include "SquidTime.h"
#include "wordlist.h"
-#if ICAP_CLIENT
-#include "ICAP/ICAPModXact.h"
-#include "ICAP/ICAPElements.h"
-#include "ICAP/ICAPConfig.h"
-static void icapAclCheckDoneWrapper(ICAPServiceRep::Pointer service, void *data);
-extern ICAPConfig TheICAPConfig;
+#if USE_ADAPTATION
+#include "ICAP/ICAPConfig.h" /* XXX: replace with generic adaptation config */
+static void adaptationAclCheckDoneWrapper(Adaptation::ServicePointer service, void *data);
#endif
#if LINGERING_CLOSE
}
ClientHttpRequest::ClientHttpRequest(ConnStateData * aConn) :
-#if ICAP_CLIENT
+#if USE_ADAPTATION
AsyncJob("ClientHttpRequest"),
#endif
loggingEntry_(NULL)
start_time = current_time;
setConn(aConn);
dlinkAdd(this, &active, &ClientActiveRequests);
-#if ICAP_CLIENT
+#if USE_ADAPTATION
request_satisfaction_mode = false;
#endif
}
freeResources();
-#if ICAP_CLIENT
- announceInitiatorAbort(icapHeadSource);
+#if USE_ADAPTATION
+ announceInitiatorAbort(virginHeadSource);
- if (icapBodySource != NULL)
- stopConsumingFrom(icapBodySource);
+ if (adaptedBodySource != NULL)
+ stopConsumingFrom(adaptedBodySource);
#endif
if (calloutContext)
http->doCallouts();
}
-#if ICAP_CLIENT
+#if USE_ADAPTATION
void
-ClientRequestContext::icapAccessCheck()
+ClientRequestContext::adaptationAccessCheck()
{
- ICAPAccessCheck *icap_access_check;
+ Adaptation::AccessCheck *check = new Adaptation::AccessCheck(
+ Adaptation::methodReqmod, Adaptation::pointPreCache,
+ http->request, NULL, adaptationAclCheckDoneWrapper, this);
- icap_access_check = new ICAPAccessCheck(ICAP::methodReqmod, ICAP::pointPreCache, http->request, NULL, icapAclCheckDoneWrapper, this);
-
- if (icap_access_check != NULL) {
- icap_access_check->check();
- return;
- }
-
- http->doCallouts();
+ check->check(); // will eventually delete self
}
static void
-icapAclCheckDoneWrapper(ICAPServiceRep::Pointer service, void *data)
+adaptationAclCheckDoneWrapper(Adaptation::ServicePointer service, void *data)
{
ClientRequestContext *calloutContext = (ClientRequestContext *)data;
if (!calloutContext->httpStateIsValid())
return;
- calloutContext->icapAclCheckDone(service);
+ calloutContext->adaptationAclCheckDone(service);
}
void
-ClientRequestContext::icapAclCheckDone(ICAPServiceRep::Pointer service)
+ClientRequestContext::adaptationAclCheckDone(Adaptation::ServicePointer service)
{
- debugs(93,3,HERE << this << " icapAclCheckDone called");
+ debugs(93,3,HERE << this << " adaptationAclCheckDone called");
assert(http);
- if (http->startIcap(service))
+ if (http->startAdaptation(service))
return;
- if (!service || service->bypass) {
+ if (!service || service->cfg().bypass) {
// handle ICAP start failure when no service was selected
// or where the selected service was optional
http->doCallouts();
}
// handle start failure for an essential ICAP service
- http->handleIcapFailure();
+ http->handleAdaptationFailure();
}
#endif
return;
}
-#if ICAP_CLIENT
- if (TheICAPConfig.onoff && !calloutContext->icap_acl_check_done) {
- debugs(83, 3, HERE << "Doing calloutContext->icapAccessCheck()");
- calloutContext->icap_acl_check_done = true;
- calloutContext->icapAccessCheck();
+#if USE_ADAPTATION
+ if (TheICAPConfig.onoff && !calloutContext->adaptation_acl_check_done) {
+ debugs(83, 3, HERE << "Doing calloutContext->adaptationAccessCheck()");
+ calloutContext->adaptation_acl_check_done = true;
+ calloutContext->adaptationAccessCheck();
return;
}
#include "client_side_request.cci"
#endif
-#if ICAP_CLIENT
+#if USE_ADAPTATION
/*
* Initiate an ICAP transaction. Return false on errors.
* The caller must handle errors.
*/
bool
-ClientHttpRequest::startIcap(ICAPServiceRep::Pointer service)
+ClientHttpRequest::startAdaptation(Adaptation::ServicePointer service)
{
- debugs(85, 3, HERE << this << " ClientHttpRequest::startIcap() called");
+ debugs(85, 3, HERE << this << " ClientHttpRequest::startAdaptation() called");
if (!service) {
- debugs(85, 3, "ClientHttpRequest::startIcap fails: lack of service");
+ debugs(85, 3, "ClientHttpRequest::startAdaptation fails: lack of service");
return false;
}
if (service->broken()) {
- debugs(85, 3, "ClientHttpRequest::startIcap fails: broken service");
+ debugs(85, 3, "ClientHttpRequest::startAdaptation fails: broken service");
return false;
}
- assert(!icapHeadSource);
- assert(!icapBodySource);
- icapHeadSource = initiateIcap(
- new ICAPModXactLauncher(this, request, NULL, service));
- return icapHeadSource != NULL;
+ assert(!virginHeadSource);
+ assert(!adaptedBodySource);
+ virginHeadSource = initiateAdaptation(service->makeXactLauncher(
+ this, request, NULL));
+
+ return virginHeadSource != NULL;
}
void
-ClientHttpRequest::noteIcapAnswer(HttpMsg *msg)
+ClientHttpRequest::noteAdaptationAnswer(HttpMsg *msg)
{
assert(cbdataReferenceValid(this)); // indicates bug
assert(msg);
// subscribe to receive reply body
if (new_rep->body_pipe != NULL) {
- icapBodySource = new_rep->body_pipe;
- assert(icapBodySource->setConsumerIfNotLate(this));
+ adaptedBodySource = new_rep->body_pipe;
+ assert(adaptedBodySource->setConsumerIfNotLate(this));
}
clientStreamNode *node = (clientStreamNode *)client_stream.tail->prev->data;
request_satisfaction_offset = 0;
storeEntry()->replaceHttpReply(new_rep);
- if (!icapBodySource) // no body
+ if (!adaptedBodySource) // no body
storeEntry()->complete();
clientGetMoreData(node, this);
}
// we are done with getting headers (but may be receiving body)
- clearIcap(icapHeadSource);
+ clearAdaptation(virginHeadSource);
if (!request_satisfaction_mode)
doCallouts();
}
void
-ClientHttpRequest::noteIcapQueryAbort(bool final)
+ClientHttpRequest::noteAdaptationQueryAbort(bool final)
{
- clearIcap(icapHeadSource);
- assert(!icapBodySource);
- handleIcapFailure(!final);
+ clearAdaptation(virginHeadSource);
+ assert(!adaptedBodySource);
+ handleAdaptationFailure(!final);
}
void
ClientHttpRequest::noteMoreBodyDataAvailable(BodyPipe::Pointer)
{
assert(request_satisfaction_mode);
- assert(icapBodySource != NULL);
+ assert(adaptedBodySource != NULL);
- if (const size_t contentSize = icapBodySource->buf().contentSize()) {
- BodyPipeCheckout bpc(*icapBodySource);
+ if (const size_t contentSize = adaptedBodySource->buf().contentSize()) {
+ BodyPipeCheckout bpc(*adaptedBodySource);
const StoreIOBuffer ioBuf(&bpc.buf, request_satisfaction_offset);
storeEntry()->write(ioBuf);
// assume can write everything
bpc.checkIn();
}
- if (icapBodySource->exhausted())
+ if (adaptedBodySource->exhausted())
endRequestSatisfaction();
// else wait for more body data
}
void
ClientHttpRequest::noteBodyProductionEnded(BodyPipe::Pointer)
{
- assert(!icapHeadSource);
- if (icapBodySource != NULL) { // did not end request satisfaction yet
+ assert(!virginHeadSource);
+ if (adaptedBodySource != NULL) { // did not end request satisfaction yet
// We do not expect more because noteMoreBodyDataAvailable always
// consumes everything. We do not even have a mechanism to consume
// leftovers after noteMoreBodyDataAvailable notifications seize.
- assert(icapBodySource->exhausted());
+ assert(adaptedBodySource->exhausted());
endRequestSatisfaction();
}
}
ClientHttpRequest::endRequestSatisfaction() {
debugs(85,4, HERE << this << " ends request satisfaction");
assert(request_satisfaction_mode);
- stopConsumingFrom(icapBodySource);
+ stopConsumingFrom(adaptedBodySource);
// TODO: anything else needed to end store entry formation correctly?
storeEntry()->complete();
void
ClientHttpRequest::noteBodyProducerAborted(BodyPipe::Pointer)
{
- assert(!icapHeadSource);
- stopConsumingFrom(icapBodySource);
- handleIcapFailure();
+ assert(!virginHeadSource);
+ stopConsumingFrom(adaptedBodySource);
+ handleAdaptationFailure();
}
void
-ClientHttpRequest::handleIcapFailure(bool bypassable)
+ClientHttpRequest::handleAdaptationFailure(bool bypassable)
{
- debugs(85,3, HERE << "handleIcapFailure(" << bypassable << ")");
+ debugs(85,3, HERE << "handleAdaptationFailure(" << bypassable << ")");
const bool usedStore = storeEntry() && !storeEntry()->isEmpty();
const bool usedPipe = request->body_pipe != NULL &&
#include "dlink.h"
#include "ICAP/AsyncJob.h"
-#if ICAP_CLIENT
-#include "ICAP/ICAPServiceRep.h"
-#include "ICAP/ICAPInitiator.h"
+#if USE_ADAPTATION
+#include "adaptation/forward.h"
+#include "adaptation/Initiator.h"
class HttpMsg;
#endif
class ClientRequestContext;
class ClientHttpRequest
-#if ICAP_CLIENT
- : public ICAPInitiator, // to start ICAP transactions
+#if USE_ADAPTATION
+ : public Adaptation::Initiator, // to start adaptation transactions
public BodyConsumer // to receive reply bodies in request satisf. mode
#endif
{
public:
void *operator new (size_t);
void operator delete (void *);
-#if ICAP_CLIENT
+#if USE_ADAPTATION
void *toCbdata() { return this; }
#endif
ClientHttpRequest(ConnStateData *);
ClientRequestContext *calloutContext;
void doCallouts();
-#if ICAP_CLIENT
-//AsyncJob virtual methods
- virtual bool doneAll() const { return ICAPInitiator::doneAll() &&
+#if USE_ADAPTATION
+ // AsyncJob virtual methods
+ virtual bool doneAll() const { return Initiator::doneAll() &&
BodyConsumer::doneAll() && false;}
#endif
void sslBumpEstablish(comm_err_t errflag);
#endif
-#if ICAP_CLIENT
+#if USE_ADAPTATION
public:
- bool startIcap(ICAPServiceRep::Pointer);
+ bool startAdaptation(Adaptation::ServicePointer);
// private but exposed for ClientRequestContext
- void handleIcapFailure(bool bypassable = false);
+ void handleAdaptationFailure(bool bypassable = false);
private:
// ICAPInitiator API, called by ICAPXaction
- virtual void noteIcapAnswer(HttpMsg *message);
- virtual void noteIcapQueryAbort(bool final);
+ virtual void noteAdaptationAnswer(HttpMsg *message);
+ virtual void noteAdaptationQueryAbort(bool final);
// BodyConsumer API, called by BodyPipe
virtual void noteMoreBodyDataAvailable(BodyPipe::Pointer);
void endRequestSatisfaction();
private:
- ICAPInitiate *icapHeadSource;
- BodyPipe::Pointer icapBodySource;
+ Adaptation::Initiate *virginHeadSource;
+ BodyPipe::Pointer adaptedBodySource;
bool request_satisfaction_mode;
int64_t request_satisfaction_offset;
return;
}
-#if ICAP_CLIENT
+#if USE_ADAPTATION
- if (icapAccessCheckPending) {
- debugs(9,3, HERE << "returning from FtpStateData::processReplyBody due to icapAccessCheckPending");
+ if (adaptationAccessCheckPending) {
+ debugs(9,3, HERE << "returning from FtpStateData::processReplyBody due to adaptationAccessCheckPending");
return;
}
return;
}
-#if ICAP_CLIENT
- if (icapAccessCheckPending) {
- debugs(9,3, HERE << "returning due to icapAccessCheckPending");
+#if USE_ADAPTATION
+ if (adaptationAccessCheckPending) {
+ debugs(9,3, HERE << "returning due to adaptationAccessCheckPending");
return;
}
#endif
return;
}
-#if ICAP_CLIENT
- if (icapAccessCheckPending)
+#if USE_ADAPTATION
+ if (adaptationAccessCheckPending)
return;
#endif