#include "squid.h"
#include "comm/Connection.h"
#include "comm/Write.h"
+#include "err_detail_type.h"
#include "errorpage.h"
#if USE_AUTH
#include "auth/UserRequest.h"
#include "MemObject.h"
#include "fde.h"
#include "MemBuf.h"
+#include "protos.h"
#include "rfc1738.h"
#include "URLScheme.h"
#include "wordlist.h"
-#include "err_detail_type.h"
/**
\defgroup ErrorPageInternal Error Page Internals
}
++pos;
}
- *dt++ = '\0'; // nul-terminated the filename content string before system use.
+ *dt = '\0'; // nul-terminated the filename content string before system use.
+ ++dt;
debugs(4, 9, HERE << "STATE: dt='" << dt << "', lang='" << lang << "', pos=" << pos << ", buf='" << ((pos < hdr.size()) ? hdr.substr(pos,hdr.size()) : "") << "'");
callback(NULL),
callback_data(NULL),
request_hdrs(NULL),
- err_msg(NULL)
+ err_msg(NULL),
#if USE_SSL
- , detail(NULL)
+ detail(NULL),
#endif
+ detailCode(ERR_DETAIL_NONE)
{
memset(&flags, 0, sizeof(flags));
memset(&ftp, 0, sizeof(ftp));
if (req != NULL) {
request = HTTPMSGLOCK(req);
src_addr = req->client_addr;
- request->detailError(type, ERR_DETAIL_NONE);
}
}
HttpReply *rep;
debugs(4, 3, HERE << conn << ", err=" << err);
assert(Comm::IsConnOpen(conn));
- /*
- * ugh, this is how we make sure error codes get back to
- * the client side for logging and error tracking.
- */
-
- if (err->request)
- err->request->detailError(err->type, err->xerrno);
/* moved in front of errorBuildBuf @?@ */
err->flags.flag_cbdata = 1;
/* for backward compat we make %s show the full URL. Drop this in some future release. */
if (building_deny_info_url) {
p = request ? urlCanonical(request) : url;
- debugs(0,0, "WARNING: deny_info now accepts coded tags. Use %u to get the full URL instead of %s");
+ debugs(0, DBG_CRITICAL, "WARNING: deny_info now accepts coded tags. Use %u to get the full URL instead of %s");
} else
p = visible_appname_string;
break;
/* do not memBufClean() or delete the content, it was absorbed by httpBody */
}
+ // Make sure error codes get back to the client side for logging and
+ // error tracking.
+ if (request) {
+ int edc = ERR_DETAIL_NONE; // error detail code
+#if USE_SSL
+ if (detail)
+ edc = detail->errorNo();
+ else
+#endif
+ if (detailCode)
+ edc = detailCode;
+ else
+ edc = xerrno;
+ request->detailError(type, edc);
+ }
+
return rep;
}