#ifndef _SQUID_COMPAT_XSTRERROR_H
#define _SQUID_COMPAT_XSTRERROR_H
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
/** strerror() wrapper replacement.
*
* Provides the guarantee that a string is always returned.
#if HAVE_STRING_H
#include <string.h>
#endif
-#include "util.h"
-#include "Array.h"
#include "DiskIO/WriteRequest.h"
#include "protos.h"
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
CBDATA_CLASS_INIT(AIODiskFile);
void *
AIODiskFile::operator new(size_t unused)
#include "comm.h"
#include "aio_win32.h"
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
#if _SQUID_WINDOWS_
VOID CALLBACK IoCompletionRoutine(DWORD dwErrorCode,
DWORD dwNumberOfBytesTransfered, LPOVERLAPPED lpOverlapped)
#include "DiskIO/WriteRequest.h"
#include "protos.h"
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
CBDATA_CLASS_INIT(BlockingFile);
void *
#include <sys/ipc.h>
#include <sys/msg.h>
#include <sys/shm.h>
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
diskd_stats_t diskd_stats;
#include "Store.h"
#include "protos.h"
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
/* === PUBLIC =========================================================== */
CBDATA_CLASS_INIT(DiskThreadsDiskFile);
#include "DiskIO/ReadRequest.h"
#include "DiskIO/WriteRequest.h"
#include "globals.h"
+#include "ipc/mem/Pages.h"
#include "ipc/Messages.h"
#include "ipc/Port.h"
#include "ipc/Queue.h"
#include "ipc/StrandSearch.h"
#include "ipc/UdsOp.h"
-#include "ipc/mem/Pages.h"
-#include "StatCounters.h"
-#include "SquidTime.h"
#include "protos.h"
+#include "SquidTime.h"
+#include "StatCounters.h"
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
CBDATA_CLASS_INIT(IpcIoFile);
/// shared memory segment path to use for IpcIoFile maps
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
CBDATA_CLASS_INIT(MmappedFile);
#include <algorithm>
#include <string>
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
static void httpHeaderPutStrvf(HttpHeader * hdr, http_hdr_type id, const char *fmt, va_list vargs);
{
public:
- virtual int match (ACLData<ACLStrategy::MatchType> * &, ACLFilledChecklist *);
+ virtual int match (ACLData<MatchType> * &, ACLFilledChecklist *);
virtual bool requiresRequest() const {return true;}
static ACLMethodStrategy *Instance();
#include "squid.h"
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
typedef struct {
const char *name;
hash_table *hash;
#if HAVE_MATH_H
#include <math.h>
#endif
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
/*
* New C-like simple comm code. This stuff is a mess and doesn't really buy us anything.
#include "SquidTime.h"
#include "protos.h"
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
CBDATA_NAMESPACED_CLASS_INIT(Comm, ConnOpener);
Comm::ConnOpener::ConnOpener(Comm::ConnectionPointer &c, AsyncCall::Pointer &handler, time_t ctimeout) :
/* Solaris /dev/poll support, see "man -s 7D poll" */
#include <sys/devpoll.h>
#endif
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
#define DEBUG_DEVPOLL 0
#if HAVE_SYS_EPOLL_H
#include <sys/epoll.h>
#endif
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
static int kdpfd;
static int max_poll_time = 1000;
#if HAVE_SYS_EVENT_H
#include <sys/event.h>
#endif
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
#define KE_LENGTH 128
#if HAVE_POLL_H
#include <poll.h>
#endif
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
/* Needed for poll() on Linux at least */
#if USE_POLL
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
static int MAX_POLL_TIME = 1000; /* see also Comm::QuickPollRequired() */
#include "StatHist.h"
#include "Store.h"
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
static int MAX_POLL_TIME = 1000; /* see also Comm::QuickPollRequired() */
#ifndef howmany
#include "SquidTime.h"
#include "StatCounters.h"
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
namespace Comm
{
CBDATA_CLASS_INIT(TcpAcceptor);
#include "squid.h"
-#if USE_DELAY_POOLS
-#include "ClientInfo.h"
-#endif
#include "comm/Connection.h"
#include "comm/IoCallback.h"
#include "comm/Write.h"
#include "fde.h"
#include "globals.h"
-#include "StatCounters.h"
-#include "SquidTime.h"
#include "MemBuf.h"
#include "profiler/Profiler.h"
#include "protos.h"
+#include "SquidTime.h"
+#include "StatCounters.h"
+
+#if USE_DELAY_POOLS
+#include "ClientInfo.h"
+#endif
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
void
Comm::Write(const Comm::ConnectionPointer &conn, MemBuf *mb, AsyncCall::Pointer &callback)
#include "protos.h"
#include "StatCounters.h"
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
static PF diskHandleRead;
static PF diskHandleWrite;
#if HAVE_RESOLV_H
#include <resolv.h>
#endif
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
/* MS Visual Studio Projects are monolithic, so we need the following
#ifndef to exclude the internal DNS code from compile process when
#if HAVE_MATH_H
#include <math.h>
#endif
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
/* stack precedence rules:
* before pushing an operator onto the stack, the
#include "globals.h"
#include "ip/Address.h"
-
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
#if _SQUID_CYGWIN_
#include <squid_windows.h>
#endif
#include "ssl/ErrorDetail.h"
#include "ssl/ServerBump.h"
#endif
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
static PSC fwdPeerSelectionCompleteWrapper;
static CLCB fwdServerClosedWrapper;
#include "squid.h"
#include "CossSwapDir.h"
#include "Store.h"
-
#include "store_coss.h"
#include "event.h"
#include "fde.h"
#include "swap_log_op.h"
#include "SquidMath.h"
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
#define STORE_META_BUFSZ 4096
int n_coss_dirs = 0;
#include "typedefs.h"
#include "SquidTime.h"
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
CBDATA_NAMESPACED_CLASS_INIT(Rock, Rebuild);
Rock::Rebuild::Rebuild(SwapDir *dir): AsyncJob("Rock::Rebuild"),
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
CBDATA_NAMESPACED_CLASS_INIT(Fs::Ufs,RebuildState);
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
int Fs::Ufs::UFSSwapDir::NumberOfUFSDirs = 0;
int *Fs::Ufs::UFSSwapDir::UFSDirToGlobalDirMapping = NULL;
#include "MemObject.h"
#endif
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
/**
\defgroup ServerProtocolFTPInternal Server-Side FTP Internals
\ingroup ServerProtocolFTPAPI
#include "Icmp6.h"
#include "Debug.h"
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
IcmpPinger::IcmpPinger() : Icmp()
{
// these start invalid. Setup properly in Open()
#include "protos.h"
#include "SquidTime.h"
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
// Instance global to be available in main() and elsewhere.
IcmpSquid icmpEngine;
#include "SwapDir.h"
#include "wordlist.h"
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
static void icpIncomingConnectionOpened(const Comm::ConnectionPointer &conn, int errNo);
/// \ingroup ServerProtocolICPInternal2
#elif HAVE_NETINET_IP_NAT_H
#include <netinet/ip_nat.h>
#endif
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
#endif /* IPF_TRANSPARENT required headers */
#include "Parsing.h"
#include "protos.h"
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
/* Qos namespace */
void
#include "snmp/Request.h"
#include "snmp/Response.h"
#endif
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
CBDATA_NAMESPACED_CLASS_INIT(Ipc, Coordinator);
Ipc::Coordinator* Ipc::Coordinator::TheInstance = NULL;
#include "ipc/StartListening.h"
#include "protos.h"
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
Ipc::StartListeningCb::StartListeningCb(): conn(NULL), errNo(0)
{
}
#include <mswsock.h>
#endif
#include <process.h>
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
struct ipc_params {
int type;
#include "protos.h"
#include "SquidTime.h"
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
/* How many buffers to keep before we say we've buffered too much */
#define LOGFILE_MAXBUFS 128
#include "log/ModStdio.h"
#include "protos.h"
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
typedef struct {
int fd;
char *buf;
#include "protos.h"
#include "structs.h"
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
/*
* This logfile TCP module is mostly inspired by a patch by Tim Starling
* from Wikimedia.
#include "protos.h"
#include "structs.h"
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
/*
* This logfile UDP module is mostly inspired by a patch by Tim Starling
* from Wikimedia.
#if HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
#if USE_WIN32_SERVICE
#include "squid_windows.h"
#include "ssl/support.h"
#include "ssl/gadgets.h"
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
const char *Ssl::BumpModeStr[] = {
"none",
"client-first",
#include "SquidMath.h"
#include "SquidTime.h"
#include "Store.h"
+#include "StoreHashIndex.h"
#include "SwapDir.h"
#include "swap_log_op.h"
#if HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
-#include "StoreHashIndex.h"
static STDIRSELECT storeDirSelectSwapDirRoundRobin;
static STDIRSELECT storeDirSelectSwapDirLeastLoad;
#include "StoreSearch.h"
#include "SquidTime.h"
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
static struct _store_rebuild_data counts;
static struct timeval rebuild_start;
#include "squid.h"
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
typedef struct {
int query_count;
int true_hit_count;
#if HAVE_GRP_H
#include <grp.h>
#endif
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
#define DEAD_MSG "\
The Squid Cache (version %s) died.\n\
#if HAVE_LIMITS_H
#include <limits.h>
#endif
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
class TunnelStateData
{
#include "StatCounters.h"
#include "Store.h"
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
#define WHOIS_PORT 43
class WhoisState
#include "squid.h"
#include "dlink.h"
+#include <iostream>
void
xassert(const char *msg, const char *file, int line)