err->xerrno = ERR_DETAIL_ICAP_RESPMOD_EARLY;
fwd->fail(err);
fwd->dontRetry(true);
- }
- else if (request) { // update logged info directly
+ } else if (request) { // update logged info directly
request->detailError(ERR_ICAP_FAILURE, ERR_DETAIL_ICAP_RESPMOD_LATE);
}
void Adaptation::Icap::ModXact::detailError(int errDetail)
{
if (HttpRequest *request = virgin.cause ?
- virgin.cause : dynamic_cast<HttpRequest*>(virgin.header)) {
+ virgin.cause : dynamic_cast<HttpRequest*>(virgin.header)) {
request->detailError(ERR_ICAP_FAILURE, errDetail);
}
}
}
TextException::TextException(const TextException& right) :
- message((right.message?xstrdup(right.message):NULL)), theFileName(right.theFileName), theLineNo(right.theLineNo), theId(right.theId)
+ message((right.message?xstrdup(right.message):NULL)), theFileName(right.theFileName), theLineNo(right.theLineNo), theId(right.theId)
{
}
TextException::TextException(const char *aMsg, const char *aFileName, int aLineNo, unsigned int anId):
- message(xstrdup(aMsg)), theFileName(aFileName), theLineNo(aLineNo), theId(anId)
+ message(xstrdup(aMsg)), theFileName(aFileName), theLineNo(aLineNo), theId(anId)
{}
TextException::~TextException() throw()
}
unsigned int TextException::FileNameHash(const char *fname)
-{
+{
const char *s = NULL;
unsigned int n = 0;
unsigned int j = 0;
unsigned int i = 0;
s = strrchr(fname, '/');
-
+
if (s)
s++;
else
// unique exception ID for transaction error detail logging
unsigned int id() const { return theId; }
-
+
virtual const char *what() const throw();
TextException& operator=(const TextException &right);
const char *theFileName;
int theLineNo;
unsigned int theId;
-
+
friend unsigned int FileNameHashCached(const char *fname);
};
}
/// Avoids "defined but not used" warnings for FileNameHashCached
-class FileNameHashCacheUser {
+class FileNameHashCacheUser
+{
bool use(void *ptr=NULL) { return ptr != &FileNameHashCached;}
};
extern const char *err_detail_type_str[];
inline
-const char *errorDetailName(int errDetailId) {
+const char *errorDetailName(int errDetailId)
+{
if (errDetailId < ERR_DETAIL_START)
return "SYSERR";
if (errDetailId < ERR_DETAIL_MAX)
return err_detail_type_str[errDetailId-ERR_DETAIL_START+2];
-
+
if (errDetailId >=ERR_DETAIL_EXCEPTION_START)
return "EXCEPTION";
LFT_HTTP_BODY_BYTES_READ,
LFT_SQUID_STATUS,
- LFT_SQUID_ERROR,
- LFT_SQUID_ERROR_DETAIL,
+ LFT_SQUID_ERROR,
+ LFT_SQUID_ERROR_DETAIL,
LFT_SQUID_HIERARCHY,
LFT_MIME_TYPE,
case LFT_SQUID_ERROR_DETAIL:
if (al->request && al->request->errDetail != ERR_DETAIL_NONE) {
if (al->request->errDetail > ERR_DETAIL_START &&
- al->request->errDetail < ERR_DETAIL_MAX)
+ al->request->errDetail < ERR_DETAIL_MAX)
out = errorDetailName(al->request->errDetail);
else {
if (al->request->errDetail >= ERR_DETAIL_EXCEPTION_START)