|
Squid Web Cache master
|
Modules | |
| Error Page Internals | |
Classes | |
| class | ErrorState |
| class | TemplateFile |
Functions | |
| static void | errorSendComplete (const Comm::ConnectionPointer &conn, char *, size_t size, Comm::Flag errflag, int, void *data) |
| void | errorInitialize (void) |
| void | errorClean (void) |
| void | errorSend (const Comm::ConnectionPointer &conn, ErrorState *err) |
| void | errorAppendEntry (StoreEntry *entry, ErrorState *err) |
a - User identity x A - Local listening IP address x B - URL with FTP %2f hack x c - Squid error code x d - seconds elapsed since request received x D - Error details x e - errno x E - strerror() x f - FTP request line x F - FTP reply line x g - FTP server message x h - cache hostname x H - server host name x i - client IP address x I - server IP address x l - HREF link for CSS stylesheet inclusion x L - HREF link for more info/contact x M - Request Method x m - Error message returned by auth helper x o - Message returned external acl helper x p - URL port # x P - Protocol x R - Full HTTP Request x S - squid signature from ERR_SIGNATURE x s - caching proxy software with version x t - local time x T - UTC x U - URL without password x u - URL with password x w - cachemgr email address x W - error data (to be included in the mailto links) x - error name x z - dns server error message x Z - Preformatted error message x
Plus logformat codes embedded using @Squid{logformat_code} syntax.
| void errorAppendEntry | ( | StoreEntry * | entry, |
| ErrorState * | err | ||
| ) |
This function generates a error page from the info contained by err and then stores the text in the specified store entry. This function should only be called by "server side routines" which need to communicate errors to the client side. It should also be called from client_side.c because we now support persistent connections, and cannot assume that we can immediately write to the socket for an error.
| entry | ?? |
| err | This object is destroyed after use in this function. |
Definition at line 738 of file errorpage.cc.
References assert, ErrorState::BuildHttpReply(), debugs, EBIT_TEST, ENTRY_ABORTED, HttpRequest::flags, StoreEntry::flags, StoreEntry::isEmpty(), StoreEntry::mem_obj, MemObject::nclients, ErrorState::page_id, ErrorState::request, RequestFlags::resetTcp, STORE_PENDING, StoreEntry::store_status, StoreEntry::storeErrorResponse(), and TCP_RESET.
Referenced by FwdState::completed(), ClientHttpRequest::doCallouts(), internalStart(), clientReplyContext::processMiss(), FwdState::retryOrBail(), clientReplyContext::setReplyToError(), UrnState::setUriResFromRequest(), CacheManager::start(), FwdState::Start(), clientReplyContext::startError(), and urnHandleReply().
| void errorClean | ( | void | ) |
Definition at line 323 of file errorpage.cc.
References ERR_NONE, error_page_count, error_text, Ssl::errorDetailClean(), ErrorDynamicPages, and safe_free.
Referenced by mainReconfigureFinish().
| void errorInitialize | ( | void | ) |
This function finds the error messages formats, and stores them in error_text[]
But only if they are not redirection URL.
Definition at line 261 of file errorpage.cc.
References Packable::appendf(), assert, ErrorDynamicPageInfo::cfgLocation, Config, ERR_MAX, ERR_NONE, err_type_str, error_page_count, error_stylesheet, error_text, Ssl::errorDetailInitialize(), ErrorDynamicPages, errorFindHardText(), SquidConfig::errorStylesheet, ErrorDynamicPageInfo::filename, TemplateFile::filename, ErrorDynamicPageInfo::id, ErrorPage::ImportStaticErrorText(), TemplateFile::loadDefault(), TemplateFile::loadFromFile(), ErrorDynamicPageInfo::page_name, MemBuf::reset(), safe_free, text, ErrorPageFile::text(), ErrorDynamicPageInfo::uri, ErrorPage::ValidateStaticError(), and xcalloc().
Referenced by mainInitialize(), and mainReconfigureFinish().
| void errorSend | ( | const Comm::ConnectionPointer & | conn, |
| ErrorState * | err | ||
| ) |
This function generates a error page from the info contained by err and then sends it to the client. The callback function errorSendComplete() is called after the page has been written to the client (clientConn). errorSendComplete() deallocates err. We need to add err to the cbdata because comm_write() requires it for all callback data pointers.
| clientConn | socket where page object is to be written |
| err | This object is destroyed after use in this function. |
Definition at line 792 of file errorpage.cc.
References assert, ErrorState::BuildHttpReply(), commCbCall(), debugs, errorSendComplete, Comm::IsConnOpen(), HttpReply::pack(), and Comm::Write().
Referenced by TunnelStateData::sendError(), and tunnelStart().
|
static |
Called by commHandleWrite() after data has been written to the client socket.
Definition at line 816 of file errorpage.cc.
References ErrorState::callback, ErrorState::callback_data, Comm::Connection::close(), debugs, Comm::ERR_CLOSING, Comm::Connection::fd, and size.