void
FwdState::fail(ErrorState * errorState)
{
- debugs(17, 3, err_type_str[errorState->type] << " \"" << Http::StatusCodeString(errorState->httpStatus) << "\"\n\t" << entry->url());
+ debugs(17, 3, errorState << "; was: " << err);
delete err;
err = errorState;
return "ERR_UNKNOWN"; /* should not happen */
}
+/// compactly prints top-level ErrorState information (for debugging)
+static std::ostream &
+operator <<(std::ostream &os, const ErrorState &err)
+{
+ os << errorPageName(err.type);
+ if (err.httpStatus != Http::scNone)
+ os << "/http_status=" << err.httpStatus;
+ return os;
+}
+
ErrorState *
ErrorState::NewForwarding(err_type type, HttpRequestPointer &request, const AccessLogEntry::Pointer &ale)
{
request = req;
src_addr = req->client_addr;
}
+
+ debugs(4, 3, "constructed, this=" << static_cast<void*>(this) << ' ' << *this);
}
ErrorState::ErrorState(HttpRequest * req, HttpReply *errorReply, const AccessLogEntry::Pointer &anAle):
request = req;
src_addr = req->client_addr;
}
+
+ debugs(4, 3, "constructed, this=" << static_cast<void*>(this) << " relaying " << *this);
}
void
ErrorState::~ErrorState()
{
+ debugs(4, 7, "destructing, this=" << static_cast<void*>(this));
+
safe_free(redirect_url);
safe_free(url);
safe_free(request_hdrs);
std::ostream &
operator <<(std::ostream &os, const ErrorState *err)
{
- if (err)
- os << errorPageName(err->page_id);
- else
- os << "[none]";
+ os << RawPointer(err).orNil();
return os;
}