#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
if (error_text) {
int i;
- for (i = ERR_NONE + 1; i < error_page_count; i++)
+ for (i = ERR_NONE + 1; i < error_page_count; ++i)
safe_free(error_text[i]);
safe_free(error_text);
{
int i;
- for (i = 0; i < error_hard_text_count; i++)
+ for (i = 0; i < error_hard_text_count; ++i)
if (error_hard_text[i].type == type)
return error_hard_text[i].text;
if (!pos) {
/* skip any initial whitespace. */
- while (pos < hdr.size() && xisspace(hdr[pos])) pos++;
+ while (pos < hdr.size() && xisspace(hdr[pos]))
+ ++pos;
} else {
// IFF we terminated the tag on whitespace or ';' we need to skip to the next ',' or end of header.
- while (pos < hdr.size() && hdr[pos] != ',') pos++;
- if (hdr[pos] == ',') pos++;
+ while (pos < hdr.size() && hdr[pos] != ',')
+ ++pos;
+ if (hdr[pos] == ',')
+ ++pos;
}
/*
if (*dt != '-' && *dt != '*' && (*dt < 'a' || *dt > 'z') )
invalid_byte = true;
else
- dt++; // move to next destination byte.
+ ++dt; // move to next destination byte.
}
- pos++;
+ ++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()) : "") << "'");
static int
errorPageId(const char *page_name)
{
- for (int i = 0; i < ERR_MAX; i++) {
+ for (int i = 0; i < ERR_MAX; ++i) {
if (strcmp(err_type_str[i], page_name) == 0)
return i;
}
- for (size_t j = 0; j < ErrorDynamicPages.size(); j++) {
+ for (size_t j = 0; j < ErrorDynamicPages.size(); ++j) {
if (strcmp(ErrorDynamicPages.items[j]->page_name, page_name) == 0)
return j + ERR_MAX;
}
}
}
-void
-ErrorState::detailError(int detailCode)
-{
- detailCode = detailCode;
-}
-
void
errorAppendEntry(StoreEntry * entry, ErrorState * err)
{
case 'R':
if (building_deny_info_url) {
p = (request->urlpath.size() != 0 ? request->urlpath.termedBuf() : "/");
+ no_urlescape = 1;
break;
}
if (NULL != request) {
AnyP::ProtocolType_str[request->http_ver.protocol],
request->http_ver.major, request->http_ver.minor);
packerToMemInit(&pck, &mb);
- request->header.packInto(&pck);
+ request->header.packInto(&pck, true); //hide authorization data
packerClean(&pck);
} else if (request_hdrs) {
p = request_hdrs;
/* 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 */
+ // 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