{
clearAdaptation(virginHeadSource);
assert(!adaptedBodySource);
- handleAdaptationFailure(ERR_DETAIL_ICAP_REQMOD_ABORT, !final);
+ handleAdaptationFailure(ERR_DETAIL_CLT_REQMOD_ABORT, !final);
}
void
{
assert(!virginHeadSource);
stopConsumingFrom(adaptedBodySource);
- handleAdaptationFailure(ERR_DETAIL_ICAP_RESPMOD_CLT_SIDE_BODY);
+
+ debugs(85,3, HERE << "REQMOD body production failed");
+ if (request_satisfaction_mode) { // too late to recover or serve an error
+ request->detailError(ERR_ICAP_FAILURE, ERR_DETAIL_CLT_REQMOD_RESP_BODY);
+ const int fd = getConn()->fd;
+ Must(fd >= 0);
+ comm_close(fd); // drastic, but we may be writing a response already
+ } else {
+ handleAdaptationFailure(ERR_DETAIL_CLT_REQMOD_REQ_BODY);
+ }
}
void
typedef enum {
ERR_DETAIL_NONE,
ERR_DETAIL_START = 100000, // to avoid clashes with most OS error numbers
- ERR_DETAIL_ICAP_REQMOD_ABORT = ERR_DETAIL_START, // transaction abort
- ERR_DETAIL_ICAP_RESPMOD_CLT_SIDE_BODY, // client-side detected body abort
+ ERR_DETAIL_CLT_REQMOD_ABORT = ERR_DETAIL_START, // client-side detected transaction abort
+ ERR_DETAIL_CLT_REQMOD_REQ_BODY, // client-side detected REQMOD request body adaptation failure
+ ERR_DETAIL_CLT_REQMOD_RESP_BODY, // client-side detected REQMOD satisfaction reply body failure
ERR_DETAIL_ICAP_RESPMOD_EARLY, // RESPMOD failed w/o store entry
ERR_DETAIL_ICAP_RESPMOD_LATE, // RESPMOD failed with a store entry
ERR_DETAIL_ICAP_XACT_START, // transaction start failure