/*
* DEBUG: section 04 Error Generation
* AUTHOR: Duane Wessels
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
* ----------------------------------------------------------
*
* Squid is the result of efforts by numerous individuals from
* the Internet community; see the CONTRIBUTORS file for full
* details. Many organizations have provided support for Squid's
* development; see the SPONSORS file for full details. Squid is
* Copyrighted (C) 2001 by the Regents of the University of
* California; see the COPYRIGHT file for full details. Squid
* incorporates software developed and/or copyrighted by other
* sources; see the CREDITS file for full details.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
*
*/
#include "squid.h"
#include "cache_cf.h"
#include "comm/Connection.h"
#include "comm/Write.h"
#include "disk.h"
#include "err_detail_type.h"
#include "errorpage.h"
#include "ftp.h"
#include "Store.h"
#include "html_quote.h"
#include "HttpHeaderTools.h"
#include "HttpReply.h"
#include "HttpRequest.h"
#include "MemObject.h"
#include "fde.h"
#include "MemBuf.h"
#include "rfc1738.h"
#include "SquidConfig.h"
#include "URL.h"
#include "URLScheme.h"
#include "URL.h"
#include "tools.h"
#include "wordlist.h"
#if USE_AUTH
#include "auth/UserRequest.h"
#endif
#include "SquidTime.h"
#if USE_SSL
#include "ssl/ErrorDetailManager.h"
#endif
/**
\defgroup ErrorPageInternal Error Page Internals
\ingroup ErrorPageAPI
*
\section Abstract Abstract:
* These routines are used to generate error messages to be
* sent to clients. The error type is used to select between
* the various message formats. (formats are stored in the
* Config.errorDirectory)
*/
#if !defined(DEFAULT_SQUID_ERROR_DIR)
/** Where to look for errors if config path fails.
\note Please use ./configure --datadir=/path instead of patching
*/
#define DEFAULT_SQUID_ERROR_DIR DEFAULT_SQUID_DATA_DIR"/errors"
#endif
/// \ingroup ErrorPageInternal
CBDATA_CLASS_INIT(ErrorState);
/* local types */
/// \ingroup ErrorPageInternal
typedef struct {
int id;
char *page_name;
Http::StatusCode page_redirect;
} ErrorDynamicPageInfo;
/* local constant and vars */
/**
\ingroup ErrorPageInternal
*
\note hard coded error messages are not appended with %S
* automagically to give you more control on the format
*/
static const struct {
int type; /* and page_id */
const char *text;
}
error_hard_text[] = {
{
ERR_SQUID_SIGNATURE,
"\n
\n"
"