From: robertc <> Date: Tue, 15 Jul 2003 17:33:21 +0000 (+0000) Subject: Summary: Remove more global mem pools. X-Git-Tag: SQUID_3_0_PRE1~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=51ee7c8284c6674ef019929147d748314d78bdea;p=thirdparty%2Fsquid.git Summary: Remove more global mem pools. Keywords: Give HttpRequest it's own mempool. Give storeSwapLogData it's own file, mem pool. Provide a file_write adapter for objects. Give helper_stateful_request it's own mem pool. Move into new file helper.h Give helper_request it's own mem pool. Move into new file helper.h --- diff --git a/src/HttpRequest.cc b/src/HttpRequest.cc index dfd7d552b7..248b56f03b 100644 --- a/src/HttpRequest.cc +++ b/src/HttpRequest.cc @@ -1,6 +1,6 @@ /* - * $Id: HttpRequest.cc,v 1.40 2003/07/15 06:50:41 robertc Exp $ + * $Id: HttpRequest.cc,v 1.41 2003/07/15 11:33:21 robertc Exp $ * * DEBUG: section 73 HTTP Request * AUTHOR: Duane Wessels @@ -31,6 +31,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * + * Copyright (c) 2003, Robert Collins */ #include "HttpRequest.h" @@ -39,18 +40,24 @@ #include "HttpHeaderRange.h" static void httpRequestHdrCacheInit(request_t * req); +MemPool (*HttpRequest::Pool)(NULL); void * -HttpRequest::operator new(size_t amount) +HttpRequest::operator new (size_t byteCount) { - // Todo: assign private pool. - return static_cast(memAllocate(MEM_REQUEST_T)); + /* derived classes with different sizes must implement their own new */ + assert (byteCount == sizeof (HttpRequest)); + + if (!Pool) + Pool = memPoolCreate("HttpRequest", sizeof (HttpRequest)); + + return memPoolAlloc(Pool); } void -HttpRequest::operator delete(void *address) +HttpRequest::operator delete (void *address) { - memFree(address, MEM_REQUEST_T); + memPoolFree (Pool, address); } void diff --git a/src/HttpRequest.h b/src/HttpRequest.h index c1e8214faa..c3ff7e1183 100644 --- a/src/HttpRequest.h +++ b/src/HttpRequest.h @@ -1,6 +1,6 @@ /* - * $Id: HttpRequest.h,v 1.4 2003/07/15 06:50:41 robertc Exp $ + * $Id: HttpRequest.h,v 1.5 2003/07/15 11:33:21 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -100,6 +100,9 @@ public: String extacl_user; /* User name returned by extacl lookup */ String extacl_passwd; /* Password returned by extacl lookup */ String extacl_log; /* String to be used for access.log purposes */ + +private: + static MemPool *Pool; }; typedef HttpRequest request_t; diff --git a/src/Makefile.am b/src/Makefile.am index a4d9644719..a4932cb1a8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.am,v 1.82 2003/07/14 14:15:56 robertc Exp $ +# $Id: Makefile.am,v 1.83 2003/07/15 11:33:21 robertc Exp $ # # Uncomment and customize the following to suit your needs: # @@ -9,780 +9,814 @@ if USE_DNSSERVER DNSSOURCE = dns.cc -DNSSERVER = dnsserver -else -DNSSOURCE = dns_internal.cc -DNSSERVER = -endif - -if USE_SNMP -SNMPSOURCE = snmp_core.cc snmp_agent.cc -else -SNMPSOURCE = -endif - -DELAY_POOL_ALL_SOURCE = \ - CommonPool.h \ - CompositePoolNode.h \ - delay_pools.cc \ - DelayId.cc \ - DelayId.h \ - DelayIdComposite.h \ - DelayBucket.cc \ - DelayBucket.h \ - DelayConfig.cc \ - DelayConfig.h \ - DelayPool.cc \ - DelayPool.h \ - DelayPools.h \ - DelaySpec.cc \ - DelaySpec.h \ - DelayTagged.cc \ - DelayTagged.h \ - DelayUser.cc \ - DelayUser.h \ - DelayVector.cc \ - DelayVector.h \ - NullDelayId.cc \ - NullDelayId.h -if USE_DELAY_POOLS -DELAY_POOL_SOURCE = $(DELAY_POOL_ALL_SOURCE) -else -DELAY_POOL_SOURCE = -endif - -ESI_ALL_SOURCE = \ - ElementList.h \ - ESI.cc \ - ESI.h \ - ESIAssign.cc \ - ESIAssign.h \ - ESIAttempt.h \ - ESIContext.cc \ - ESIContext.h \ - ESICustomParser.cc \ - ESICustomParser.h \ - ESIElement.h \ - ESIExcept.h \ - ESIExpatParser.cc \ - ESIExpatParser.h \ - ESIExpression.cc \ - ESIExpression.h \ - ESIInclude.cc \ - ESIInclude.h \ - ESILiteral.h \ - ESIParser.cc \ - ESIParser.h \ - ESISegment.cc \ - ESISegment.h \ - ESISequence.cc \ - ESISequence.h \ - ESIVar.h \ - ESIVarState.cc \ - ESIVarState.h -if USE_ESI - ESI_SOURCE = $(ESI_ALL_SOURCE) -else - ESI_SOURCE = -endif - -if ENABLE_XPROF_STATS -XPROF_STATS_SOURCE = ProfStats.cc -else -XPROF_STATS_SOURCE = -endif - -if ENABLE_HTCP -HTCPSOURCE = htcp.cc htcp.h -endif - -if MAKE_LEAKFINDER -LEAKFINDERSOURCE = leakfinder.cc -else -LEAKFINDERSOURCE = -endif - -if ENABLE_UNLINKD -UNLINKDSOURCE = unlinkd.cc -UNLINKD = unlinkd -else -UNLINKDSOURCE = -UNLINKD = -endif - -if ENABLE_PINGER -PINGER = pinger -else -PINGER = -endif - -SSL_ALL_SOURCE = \ - ACLCertificateData.cc \ - ACLCertificateData.h \ - ACLCertificate.cc \ - ACLCertificate.h \ - ssl_support.cc \ - ssl_support.h -if ENABLE_SSL -SSL_SOURCE = $(SSL_ALL_SOURCE) -else -SSL_SOURCE = -endif - -if ENABLE_WIN32SPECIFIC -WIN32SOURCE = win32.cc -else -WIN32SOURCE = -endif - -IDENT_ALL_SOURCE = ACLIdent.cc ACLIdent.h ident.cc -if ENABLE_IDENT -IDENT_SOURCE = $(IDENT_ALL_SOURCE) -else -IDENT_SOURCE = -endif - -ARP_ACL_ALL_SOURCE = ACLARP.cc ACLARP.h -if ENABLE_ARP_ACL -ARP_ACL_SOURCE = $(ARP_ACL_ALL_SOURCE) -else -ARP_ACL_SOURCE = -endif - -AM_CFLAGS = @SQUID_CFLAGS@ -AM_CXXFLAGS = @SQUID_CXXFLAGS@ - -SUBDIRS = fs repl auth - -INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include -I$(top_srcdir)/include -I$(top_srcdir)/lib/libTrie/include - -EXTRA_PROGRAMS = \ - unlinkd \ - pinger \ - dnsserver \ - recv-announce \ - ufsdump - -noinst_PROGRAMS = \ - cf_gen - -sbin_PROGRAMS = \ - squid - -bin_PROGRAMS = \ - squidclient - - -libexec_PROGRAMS = \ - $(PINGER) \ - $(DNSSERVER) \ - $(UNLINKD) \ - cachemgr$(CGIEXT) - -cf_gen_SOURCES = cf_gen.cc defines.h -nodist_cf_gen_HEADER = cf_gen_defines.h -cf_gen.$(OBJEXT): cf_gen_defines.h -squidclient_SOURCES = client.cc -cachemgr__CGIEXT__SOURCES = cachemgr.cc - -EXTRA_squid_SOURCES = \ - $(ARP_ACL_ALL_SOURCE) \ - $(DELAY_POOL_ALL_SOURCE) \ - dns.cc \ - dnsserver.cc \ - dns_internal.cc \ - htcp.cc \ - $(IDENT_ALL_SOURCE) \ - $(ESI_ALL_SOURCE) \ - ProfStats.cc \ - leakfinder.cc \ - snmp_core.cc \ - snmp_agent.cc \ - unlinkd.cc \ - $(SSL_ALL_SOURCE) \ - win32.cc - -squid_ACLSOURCES = \ - $(ARP_ACL_SOURCE) \ - ACLASN.cc \ - ACLASN.h \ - ACLDestinationASN.h \ - ACLSourceASN.h \ - ACLBrowser.cc \ - ACLBrowser.h \ - ACLData.h \ - ACLDestinationDomain.cc \ - ACLDestinationDomain.h \ - ACLDestinationIP.cc \ - ACLDestinationIP.h \ - ACLDomainData.h \ - ACLDomainData.cc \ - ACLExtUser.h \ - ACLExtUser.cc \ - ACLIntRange.cc \ - ACLIntRange.h \ - ACLIP.cc \ - ACLIP.h \ - ACLMaxConnection.cc \ - ACLMaxConnection.h \ - ACLMaxUserIP.cc \ - ACLMaxUserIP.h \ - ACLMethod.cc \ - ACLMethod.h \ - ACLMethodData.cc \ - ACLMethodData.h \ - ACLMyIP.cc \ - ACLMyIP.h \ - ACLMyPort.cc \ - ACLMyPort.h \ - ACLProtocol.cc \ - ACLProtocol.h \ - ACLProtocolData.cc \ - ACLProtocolData.h \ - ACLProxyAuth.cc \ - ACLProxyAuth.h \ - ACLReferer.cc \ - ACLReferer.h \ - ACLRegexData.cc \ - ACLRegexData.h \ - ACLReplyHeaderStrategy.h \ - ACLReplyMIMEType.cc \ - ACLReplyMIMEType.h \ - ACLRequestHeaderStrategy.h \ - ACLRequestMIMEType.cc \ - ACLRequestMIMEType.h \ - ACLSourceDomain.cc \ - ACLSourceDomain.h \ - ACLSourceIP.cc \ - ACLSourceIP.h \ - ACLStrategised.cc \ - ACLStrategised.h \ - ACLStrategy.h \ - ACLStringData.cc \ - ACLStringData.h \ - ACLTime.cc \ - ACLTime.h \ - ACLTimeData.cc \ - ACLTimeData.h \ - ACLUrl.cc \ - ACLUrl.h \ - ACLUrlPath.cc \ - ACLUrlPath.h \ - ACLUrlPort.cc \ - ACLUrlPort.h \ - ACLUserData.cc \ - ACLUserData.h - -squid_SOURCES = \ - access_log.cc \ - acl.cc \ - ACL.h \ - ACLChecklist.cc \ - ACLChecklist.h \ - $(squid_ACLSOURCES) \ - asn.cc \ - authenticate.cc \ - authenticate.h \ - cache_cf.cc \ - CacheDigest.cc \ - cache_manager.cc \ - carp.cc \ - cbdata.cc \ - client_db.cc \ - client_side.cc \ - client_side.h \ - client_side_reply.cc \ - client_side_reply.h \ - client_side_request.cc \ - client_side_request.h \ - clientStream.cc \ - clientStream.h \ - comm.cc \ - comm.h \ - comm_select.cc \ - comm_poll.cc \ - comm_kqueue.cc \ - comm_epoll.cc \ - CommRead.h \ - ConfigParser.h \ - ConnectionDetail.h \ - debug.cc \ - Debug.h \ - defines.h \ - $(DELAY_POOL_SOURCE) \ - disk.cc \ - $(DNSSOURCE) \ - enums.h \ - errorpage.cc \ - $(ESI_SOURCE) \ - ETag.cc \ - event.cc \ - external_acl.cc \ - ExternalACL.h \ - ExternalACLEntry.cc \ - ExternalACLEntry.h \ - fd.cc \ - fde.cc \ - fde.h \ - filemap.cc \ - forward.cc \ - fqdncache.cc \ - ftp.cc \ - Generic.h \ - globals.h \ - gopher.cc \ - helper.cc \ - $(HTCPSOURCE) \ - http.cc \ - http.h \ - HttpStatusLine.cc \ - HttpHdrCc.cc \ - HttpHdrRange.cc \ - HttpHdrSc.cc \ - HttpHdrScTarget.cc \ - HttpHdrContRange.cc \ - HttpHdrContRange.h \ - HttpHeader.cc \ - HttpHeader.h \ - HttpHeaderRange.h \ - HttpHeaderTools.cc \ - HttpBody.cc \ - HttpMsg.cc \ - HttpReply.cc \ - HttpReply.h \ - HttpRequest.cc \ - HttpRequest.h \ - icmp.cc \ - ICP.h \ - icp_v2.cc \ - icp_v3.cc \ - $(IDENT_SOURCE) \ - int.cc \ - internal.cc \ - ipc.cc \ - ipcache.cc \ - IPInterception.cc \ - IPInterception.h \ - $(LEAKFINDERSOURCE) \ - logfile.cc \ - main.cc \ - mem.cc \ - mem_node.cc \ - mem_node.h \ - Mem.h \ - MemBuf.cc \ - MemObject.cc \ - MemObject.h \ - mime.cc \ - multicast.cc \ - neighbors.cc \ - net_db.cc \ - Packer.cc \ - $(XPROF_STATS_SOURCE) \ - pconn.cc \ - peer_digest.cc \ - peer_select.cc \ - protos.h \ - redirect.cc \ - referer.cc \ - refresh.cc \ - send-announce.cc \ - $(SNMPSOURCE) \ - squid.h \ - SquidNew.cc \ - tunnel.cc \ - $(SSL_SOURCE) \ - stat.cc \ - StatHist.cc \ - String.cc \ - stmem.cc \ - stmem.h \ - store.cc \ - Store.h \ - store_io.cc \ - StoreIOBuffer.h \ - StoreIOState.cc \ - StoreIOState.h \ - store_client.cc \ - StoreClient.h \ - store_digest.cc \ - store_dir.cc \ - store_key_md5.cc \ - store_log.cc \ - store_rebuild.cc \ - store_swapin.cc \ - store_swapmeta.cc \ - store_swapout.cc \ - StoreMeta.cc \ - StoreMeta.h \ - StoreMetaMD5.cc \ - StoreMetaMD5.h \ - StoreMetaSTD.cc \ - StoreMetaSTD.h \ - StoreMetaUnpacker.cc \ - StoreMetaUnpacker.h \ - StoreMetaURL.cc \ - StoreMetaURL.h \ - StoreMetaVary.cc \ - StoreMetaVary.h \ - structs.h \ - SwapDir.cc \ - SwapDir.h \ - tools.cc \ - typedefs.h \ - ufscommon.cc \ - ufscommon.h \ - $(UNLINKDSOURCE) \ - url.cc \ - urn.cc \ - useragent.cc \ - wais.cc \ - wccp.cc \ - whois.cc \ - $(WIN32SOURCE) - -noinst_HEADERS = ACLChecklist.cci \ - client_side_request.cci \ - MemBuf.cci \ - MemBuf.h \ - Store.cci \ - String.cci \ - SquidString.h \ - ufscommon.cci \ - squid_windows.h - -nodist_squid_SOURCES = \ - repl_modules.cc \ - auth_modules.cc \ - store_modules.cc \ - cf_parser.h \ - globals.cc \ - string_arrays.c - -squid_LDADD = \ - -L../lib \ - @XTRA_OBJS@ \ - @REPL_OBJS@ \ - @STORE_OBJS@ \ - @AUTH_OBJS@ \ - @CRYPTLIB@ \ - @REGEXLIB@ \ - @SNMPLIB@ \ - @LIB_MALLOC@ \ - @SSLLIB@ \ - -lmiscutil \ - @XTRA_LIBS@ \ - @EPOLL_LIBS@ -squid_DEPENDENCIES = $(top_builddir)/lib/libmiscutil.a @STORE_OBJS@ - -unlinkd_SOURCES = unlinkd.cc SquidNew.cc -unlinkd_CXXFLAGS = -DUNLINK_DAEMON - -pinger_SOURCES = \ - pinger.cc \ - debug.cc \ - SquidNew.cc - -dnsserver_SOURCES = dnsserver.cc SquidNew.cc -recv_announce_SOURCES = recv-announce.cc SquidNew.cc - -ufsdump_SOURCES = debug.cc \ - int.cc \ - ufsdump.cc \ - store.cc \ - StoreMeta.cc \ - StoreMeta.h \ - StoreMetaMD5.cc \ - StoreMetaMD5.h \ - StoreMetaSTD.cc \ - StoreMetaSTD.h \ - StoreMetaUnpacker.cc \ - StoreMetaUnpacker.h \ - StoreMetaURL.cc \ - StoreMetaURL.h \ - StoreMetaVary.cc \ - StoreMetaVary.h \ - access_log.cc \ - acl.cc \ - ACLChecklist.cc \ - $(squid_ACLSOURCES) \ - asn.cc \ - authenticate.cc \ - cache_cf.cc \ - CacheDigest.cc \ - cache_manager.cc \ - carp.cc \ - cbdata.cc \ - client_db.cc \ - client_side.cc \ - client_side_reply.cc \ - client_side_request.cc \ - client_side_request.h \ - clientStream.cc \ - clientStream.h \ - comm.cc \ - comm.h \ - comm_select.cc \ - comm_poll.cc \ - comm_kqueue.cc \ - comm_epoll.cc \ - defines.h \ - $(DELAY_POOL_SOURCE) \ - disk.cc \ - $(DNSSOURCE) \ - enums.h \ - errorpage.cc \ - $(ESI_SOURCE) \ - ETag.cc \ - event.cc \ - external_acl.cc \ - fd.cc \ - fde.cc \ - fde.h \ - filemap.cc \ - forward.cc \ - fqdncache.cc \ - ftp.cc \ - gopher.cc \ - helper.cc \ - $(HTCPSOURCE) \ - http.cc \ - HttpStatusLine.cc \ - HttpHdrCc.cc \ - HttpHdrRange.cc \ - HttpHdrSc.cc \ - HttpHdrScTarget.cc \ - HttpHdrContRange.cc \ - HttpHeader.cc \ - HttpHeaderTools.cc \ - HttpBody.cc \ - HttpMsg.cc \ - HttpReply.cc \ - HttpRequest.cc \ - HttpRequest.h \ - icmp.cc \ - icp_v2.cc \ - icp_v3.cc \ - $(IDENT_SOURCE) \ - internal.cc \ - ipc.cc \ - ipcache.cc \ - IPInterception.cc \ - IPInterception.h \ - $(LEAKFINDERSOURCE) \ - logfile.cc \ - mem.cc \ - mem_node.cc \ - mem_node.h \ - Mem.h \ - MemBuf.cc \ - MemObject.cc \ - MemObject.h \ - mime.cc \ - multicast.cc \ - neighbors.cc \ - net_db.cc \ - Packer.cc \ - $(XPROF_STATS_SOURCE) \ - pconn.cc \ - peer_digest.cc \ - peer_select.cc \ - protos.h \ - redirect.cc \ - referer.cc \ - refresh.cc \ - send-announce.cc \ - $(SNMPSOURCE) \ - squid.h \ - $(SSL_SOURCE) \ - tunnel.cc \ - SquidNew.cc \ - stat.cc \ - StatHist.cc \ - String.cc \ - stmem.cc \ - store_io.cc \ - StoreIOBuffer.h \ - StoreIOState.cc \ - store_client.cc \ - StoreClient.h \ - store_digest.cc \ - store_dir.cc \ - store_key_md5.cc \ - store_log.cc \ - store_rebuild.cc \ - store_swapin.cc \ - store_swapmeta.cc \ - store_swapout.cc \ - structs.h \ - SwapDir.cc \ - tools.cc \ - typedefs.h \ - ufscommon.cc \ - ufscommon.h \ - $(UNLINKDSOURCE) \ - url.cc \ - urn.cc \ - useragent.cc \ - wais.cc \ - wccp.cc \ - whois.cc \ - $(WIN32SOURCE) -ufsdump_LDADD = \ - -L../lib \ - @XTRA_OBJS@ \ - @REPL_OBJS@ \ - @STORE_OBJS@ \ - @AUTH_OBJS@ \ - @CRYPTLIB@ \ - @REGEXLIB@ \ - @SNMPLIB@ \ - @LIB_MALLOC@ \ - @SSLLIB@ \ - -lmiscutil \ - @XTRA_LIBS@ \ - @EPOLL_LIBS@ -ufsdump_DEPENDENCIES = $(top_builddir)/lib/libmiscutil.a -nodist_ufsdump_SOURCES = \ - repl_modules.cc \ - auth_modules.cc \ - store_modules.cc \ - cf_parser.h \ - globals.cc \ - string_arrays.c - -nodist_pinger_SOURCES = \ - globals.cc - -BUILT_SOURCES = \ - cf_gen_defines.h \ - cf_parser.h \ - globals.cc \ - string_arrays.c \ - repl_modules.cc \ - auth_modules.cc \ - store_modules.cc - -sysconf_DATA = \ - squid.conf.default \ - mime.conf.default - -data_DATA = \ - mib.txt - -LDADD = -L../lib -lmiscutil @XTRA_LIBS@ @EPOLL_LIBS@ - -EXTRA_DIST = \ - cf_gen_defines \ - cf.data.pre \ - mk-globals-c.pl \ - mk-string-arrays.pl \ - auth_modules.sh \ - store_modules.sh \ - repl_modules.sh \ - mib.txt \ - mime.conf.default - -DEFAULT_PREFIX = $(prefix) -DEFAULT_CONFIG_FILE = $(sysconfdir)/squid.conf -DEFAULT_MIME_TABLE = $(sysconfdir)/mime.conf -DEFAULT_DNSSERVER = $(libexecdir)/dnsserver$(EXEEXT) -DEFAULT_LOG_PREFIX = $(localstatedir)/logs -DEFAULT_CACHE_LOG = $(DEFAULT_LOG_PREFIX)/cache.log -DEFAULT_ACCESS_LOG = $(DEFAULT_LOG_PREFIX)/access.log -DEFAULT_STORE_LOG = $(DEFAULT_LOG_PREFIX)/store.log -DEFAULT_PID_FILE = $(DEFAULT_LOG_PREFIX)/squid.pid -DEFAULT_SWAP_DIR = $(localstatedir)/cache -DEFAULT_PINGER = $(libexecdir)/pinger$(EXEEXT) -DEFAULT_UNLINKD = $(libexecdir)/unlinkd$(EXEEXT) -DEFAULT_DISKD = $(libexecdir)/diskd$(EXEEXT) -DEFAULT_ICON_DIR = $(datadir)/icons -DEFAULT_ERROR_DIR = $(datadir)/errors/@ERR_DEFAULT_LANGUAGE@ -DEFAULT_MIB_PATH = $(datadir)/mib.txt -DEFAULT_HOSTS = @OPT_DEFAULT_HOSTS@ - -DEFS = @DEFS@ -DDEFAULT_CONFIG_FILE=\"$(DEFAULT_CONFIG_FILE)\" - -$(OBJS): $(top_srcdir)/include/version.h ../include/autoconf.h - -snmp_core.o snmp_agent.o: ../snmplib/libsnmp.a $(top_srcdir)/include/cache_snmp.h - -globals.cc: globals.h mk-globals-c.pl - $(PERL) $(srcdir)/mk-globals-c.pl < $(srcdir)/globals.h > $@ - -string_arrays.c: enums.h mk-string-arrays.pl - $(PERL) $(srcdir)/mk-string-arrays.pl < $(srcdir)/enums.h > $@ - -cache_diff: cache_diff.o debug.o globals.o store_key_md5.o - $(CC) -o $@ $(LDFLAGS) $@.o debug.o globals.o store_key_md5.o $(STD_APP_LIBS) - -test_cache_digest: test_cache_digest.o CacheDigest.o debug.o globals.o store_key_md5.o - $(CC) -o $@ $(LDFLAGS) $@.o CacheDigest.o debug.o globals.o store_key_md5.o $(STD_APP_LIBS) + DNSSERVER = dnsserver + else + DNSSOURCE = dns_internal.cc + DNSSERVER = + endif + + if USE_SNMP + SNMPSOURCE = snmp_core.cc snmp_agent.cc + else + SNMPSOURCE = + endif + + DELAY_POOL_ALL_SOURCE = \ + CommonPool.h \ + CompositePoolNode.h \ + delay_pools.cc \ + DelayId.cc \ + DelayId.h \ + DelayIdComposite.h \ + DelayBucket.cc \ + DelayBucket.h \ + DelayConfig.cc \ + DelayConfig.h \ + DelayPool.cc \ + DelayPool.h \ + DelayPools.h \ + DelaySpec.cc \ + DelaySpec.h \ + DelayTagged.cc \ + DelayTagged.h \ + DelayUser.cc \ + DelayUser.h \ + DelayVector.cc \ + DelayVector.h \ + NullDelayId.cc \ + NullDelayId.h + if USE_DELAY_POOLS + DELAY_POOL_SOURCE = $(DELAY_POOL_ALL_SOURCE) + else + DELAY_POOL_SOURCE = + endif + + ESI_ALL_SOURCE = \ + ElementList.h \ + ESI.cc \ + ESI.h \ + ESIAssign.cc \ + ESIAssign.h \ + ESIAttempt.h \ + ESIContext.cc \ + ESIContext.h \ + ESICustomParser.cc \ + ESICustomParser.h \ + ESIElement.h \ + ESIExcept.h \ + ESIExpatParser.cc \ + ESIExpatParser.h \ + ESIExpression.cc \ + ESIExpression.h \ + ESIInclude.cc \ + ESIInclude.h \ + ESILiteral.h \ + ESIParser.cc \ + ESIParser.h \ + ESISegment.cc \ + ESISegment.h \ + ESISequence.cc \ + ESISequence.h \ + ESIVar.h \ + ESIVarState.cc \ + ESIVarState.h + if USE_ESI + ESI_SOURCE = $(ESI_ALL_SOURCE) + else + ESI_SOURCE = + endif + + if ENABLE_XPROF_STATS + XPROF_STATS_SOURCE = ProfStats.cc + else + XPROF_STATS_SOURCE = + endif + + if ENABLE_HTCP + HTCPSOURCE = htcp.cc htcp.h + endif + + if MAKE_LEAKFINDER + LEAKFINDERSOURCE = leakfinder.cc + else + LEAKFINDERSOURCE = + endif + + if ENABLE_UNLINKD + UNLINKDSOURCE = unlinkd.cc + UNLINKD = unlinkd + else + UNLINKDSOURCE = + UNLINKD = + endif + + if ENABLE_PINGER + PINGER = pinger + else + PINGER = + endif + + SSL_ALL_SOURCE = \ + ACLCertificateData.cc \ + ACLCertificateData.h \ + ACLCertificate.cc \ + ACLCertificate.h \ + ssl_support.cc \ + ssl_support.h + if ENABLE_SSL + SSL_SOURCE = $(SSL_ALL_SOURCE) + else + SSL_SOURCE = + endif + + if ENABLE_WIN32SPECIFIC + WIN32SOURCE = win32.cc + else + WIN32SOURCE = + endif + + IDENT_ALL_SOURCE = ACLIdent.cc ACLIdent.h ident.cc + if ENABLE_IDENT + IDENT_SOURCE = $(IDENT_ALL_SOURCE) + else + IDENT_SOURCE = + endif + + ARP_ACL_ALL_SOURCE = ACLARP.cc ACLARP.h + if ENABLE_ARP_ACL + ARP_ACL_SOURCE = $(ARP_ACL_ALL_SOURCE) + else + ARP_ACL_SOURCE = + endif + + AM_CFLAGS = @SQUID_CFLAGS@ + AM_CXXFLAGS = @SQUID_CXXFLAGS@ + + SUBDIRS = fs repl auth + + INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include -I$(top_srcdir)/include -I$(top_srcdir)/lib/libTrie/include + + EXTRA_PROGRAMS = \ + unlinkd \ + pinger \ + dnsserver \ + recv-announce \ + ufsdump + + noinst_PROGRAMS = \ + cf_gen + + sbin_PROGRAMS = \ + squid + + bin_PROGRAMS = \ + squidclient + + + libexec_PROGRAMS = \ + $(PINGER) \ + $(DNSSERVER) \ + $(UNLINKD) \ + cachemgr$(CGIEXT) + + cf_gen_SOURCES = cf_gen.cc defines.h + nodist_cf_gen_HEADER = cf_gen_defines.h + cf_gen.$(OBJEXT): cf_gen_defines.h + squidclient_SOURCES = client.cc + cachemgr__CGIEXT__SOURCES = cachemgr.cc + + EXTRA_squid_SOURCES = \ + $(ARP_ACL_ALL_SOURCE) \ + $(DELAY_POOL_ALL_SOURCE) \ + dns.cc \ + dnsserver.cc \ + dns_internal.cc \ + htcp.cc \ + $(IDENT_ALL_SOURCE) \ + $(ESI_ALL_SOURCE) \ + ProfStats.cc \ + leakfinder.cc \ + snmp_core.cc \ + snmp_agent.cc \ + unlinkd.cc \ + $(SSL_ALL_SOURCE) \ + win32.cc + + squid_ACLSOURCES = \ + $(ARP_ACL_SOURCE) \ + ACLASN.cc \ + ACLASN.h \ + ACLDestinationASN.h \ + ACLSourceASN.h \ + ACLBrowser.cc \ + ACLBrowser.h \ + ACLData.h \ + ACLDestinationDomain.cc \ + ACLDestinationDomain.h \ + ACLDestinationIP.cc \ + ACLDestinationIP.h \ + ACLDomainData.h \ + ACLDomainData.cc \ + ACLExtUser.h \ + ACLExtUser.cc \ + ACLIntRange.cc \ + ACLIntRange.h \ + ACLIP.cc \ + ACLIP.h \ + ACLMaxConnection.cc \ + ACLMaxConnection.h \ + ACLMaxUserIP.cc \ + ACLMaxUserIP.h \ + ACLMethod.cc \ + ACLMethod.h \ + ACLMethodData.cc \ + ACLMethodData.h \ + ACLMyIP.cc \ + ACLMyIP.h \ + ACLMyPort.cc \ + ACLMyPort.h \ + ACLProtocol.cc \ + ACLProtocol.h \ + ACLProtocolData.cc \ + ACLProtocolData.h \ + ACLProxyAuth.cc \ + ACLProxyAuth.h \ + ACLReferer.cc \ + ACLReferer.h \ + ACLRegexData.cc \ + ACLRegexData.h \ + ACLReplyHeaderStrategy.h \ + ACLReplyMIMEType.cc \ + ACLReplyMIMEType.h \ + ACLRequestHeaderStrategy.h \ + ACLRequestMIMEType.cc \ + ACLRequestMIMEType.h \ + ACLSourceDomain.cc \ + ACLSourceDomain.h \ + ACLSourceIP.cc \ + ACLSourceIP.h \ + ACLStrategised.cc \ + ACLStrategised.h \ + ACLStrategy.h \ + ACLStringData.cc \ + ACLStringData.h \ + ACLTime.cc \ + ACLTime.h \ + ACLTimeData.cc \ + ACLTimeData.h \ + ACLUrl.cc \ + ACLUrl.h \ + ACLUrlPath.cc \ + ACLUrlPath.h \ + ACLUrlPort.cc \ + ACLUrlPort.h \ + ACLUserData.cc \ + ACLUserData.h + + squid_SOURCES = \ + access_log.cc \ + acl.cc \ + ACL.h \ + ACLChecklist.cc \ + ACLChecklist.h \ + $(squid_ACLSOURCES) \ + asn.cc \ + authenticate.cc \ + authenticate.h \ + cache_cf.cc \ + CacheDigest.cc \ + cache_manager.cc \ + carp.cc \ + cbdata.cc \ + client_db.cc \ + client_side.cc \ + client_side.h \ + client_side_reply.cc \ + client_side_reply.h \ + client_side_request.cc \ + client_side_request.h \ + clientStream.cc \ + clientStream.h \ + comm.cc \ + comm.h \ + comm_select.cc \ + comm_poll.cc \ + comm_kqueue.cc \ + comm_epoll.cc \ + CommRead.h \ + ConfigParser.h \ + ConnectionDetail.h \ + debug.cc \ + Debug.h \ + defines.h \ + $(DELAY_POOL_SOURCE) \ + disk.cc \ + $(DNSSOURCE) \ + enums.h \ + errorpage.cc \ + $(ESI_SOURCE) \ + ETag.cc \ + event.cc \ + external_acl.cc \ + ExternalACL.h \ + ExternalACLEntry.cc \ + ExternalACLEntry.h \ + fd.cc \ + fde.cc \ + fde.h \ + filemap.cc \ + forward.cc \ + fqdncache.cc \ + ftp.cc \ + Generic.h \ + globals.h \ + gopher.cc \ + helper.cc \ + $(HTCPSOURCE) \ + http.cc \ + http.h \ + HttpStatusLine.cc \ + HttpHdrCc.cc \ + HttpHdrRange.cc \ + HttpHdrSc.cc \ + HttpHdrScTarget.cc \ + HttpHdrContRange.cc \ + HttpHdrContRange.h \ + HttpHeader.cc \ + HttpHeader.h \ + HttpHeaderRange.h \ + HttpHeaderTools.cc \ + HttpBody.cc \ + HttpMsg.cc \ + HttpReply.cc \ + HttpReply.h \ + HttpRequest.cc \ + HttpRequest.h \ + icmp.cc \ + ICP.h \ + icp_v2.cc \ + icp_v3.cc \ + $(IDENT_SOURCE) \ + int.cc \ + internal.cc \ + ipc.cc \ + ipcache.cc \ + IPInterception.cc \ + IPInterception.h \ + $(LEAKFINDERSOURCE) \ + logfile.cc \ + main.cc \ + mem.cc \ + mem_node.cc \ + mem_node.h \ + Mem.h \ + MemBuf.cc \ + MemObject.cc \ + MemObject.h \ + mime.cc \ + multicast.cc \ + neighbors.cc \ + net_db.cc \ + Packer.cc \ + $(XPROF_STATS_SOURCE) \ + pconn.cc \ + peer_digest.cc \ + peer_select.cc \ + protos.h \ + redirect.cc \ + referer.cc \ + refresh.cc \ + send-announce.cc \ + $(SNMPSOURCE) \ + squid.h \ + SquidNew.cc \ + tunnel.cc \ + $(SSL_SOURCE) \ + stat.cc \ + StatHist.cc \ + String.cc \ + stmem.cc \ + stmem.h \ + store.cc \ + Store.h \ + store_io.cc \ + StoreIOBuffer.h \ + StoreIOState.cc \ + StoreIOState.h \ + store_client.cc \ + StoreClient.h \ + store_digest.cc \ + store_dir.cc \ + store_key_md5.cc \ + store_log.cc \ + store_rebuild.cc \ + store_swapin.cc \ + store_swapmeta.cc \ + store_swapout.cc \ + StoreMeta.cc \ + StoreMeta.h \ + StoreMetaMD5.cc \ + StoreMetaMD5.h \ + StoreMetaSTD.cc \ + StoreMetaSTD.h \ + StoreMetaUnpacker.cc \ + StoreMetaUnpacker.h \ + StoreMetaURL.cc \ + StoreMetaURL.h \ + StoreMetaVary.cc \ + StoreMetaVary.h \ + StoreSwapLogData.cc \ + StoreSwapLogData.h \ + structs.h \ + SwapDir.cc \ + SwapDir.h \ + tools.cc \ + typedefs.h \ + ufscommon.cc \ + ufscommon.h \ + $(UNLINKDSOURCE) \ + url.cc \ + urn.cc \ + useragent.cc \ + wais.cc \ + wccp.cc \ + whois.cc \ + $(WIN32SOURCE) + + noinst_HEADERS = ACLChecklist.cci \ + client_side_request.cci \ + MemBuf.cci \ + MemBuf.h \ + Store.cci \ + String.cci \ + SquidString.h \ + ufscommon.cci \ + squid_windows.h + + nodist_squid_SOURCES = \ + repl_modules.cc \ + auth_modules.cc \ + store_modules.cc \ + cf_parser.h \ + globals.cc \ + string_arrays.c + + squid_LDADD = \ + -L../lib \ + @XTRA_OBJS@ \ + @REPL_OBJS@ \ + @STORE_OBJS@ \ + @AUTH_OBJS@ \ + @CRYPTLIB@ \ + @REGEXLIB@ \ + @SNMPLIB@ \ + @LIB_MALLOC@ \ + @SSLLIB@ \ + -lmiscutil \ + @XTRA_LIBS@ \ + @EPOLL_LIBS@ + squid_DEPENDENCIES = $(top_builddir)/lib/libmiscutil.a @STORE_OBJS@ + + unlinkd_SOURCES = unlinkd.cc SquidNew.cc + unlinkd_CXXFLAGS = -DUNLINK_DAEMON + + pinger_SOURCES = \ + pinger.cc \ + debug.cc \ + SquidNew.cc + + dnsserver_SOURCES = dnsserver.cc SquidNew.cc + recv_announce_SOURCES = recv-announce.cc SquidNew.cc + + ufsdump_SOURCES = debug.cc \ + int.cc \ + ufsdump.cc \ + store.cc \ + StoreMeta.cc \ + StoreMeta.h \ + StoreMetaMD5.cc \ + StoreMetaMD5.h \ + StoreMetaSTD.cc \ + StoreMetaSTD.h \ + StoreMetaUnpacker.cc \ + StoreMetaUnpacker.h \ + StoreMetaURL.cc \ + StoreMetaURL.h \ + StoreMetaVary.cc \ + StoreMetaVary.h \ + access_log.cc \ + acl.cc \ + ACLChecklist.cc \ + $(squid_ACLSOURCES) \ + asn.cc \ + authenticate.cc \ + cache_cf.cc \ + CacheDigest.cc \ + cache_manager.cc \ + carp.cc \ + cbdata.cc \ + client_db.cc \ + client_side.cc \ + client_side_reply.cc \ + client_side_request.cc \ + client_side_request.h \ + clientStream.cc \ + clientStream.h \ + comm.cc \ + comm.h \ + comm_select.cc \ + comm_poll.cc \ + comm_kqueue.cc \ + comm_epoll.cc \ + defines.h \ + $(DELAY_POOL_SOURCE) \ + disk.cc \ + $(DNSSOURCE) \ + enums.h \ + errorpage.cc \ + $(ESI_SOURCE) \ + ETag.cc \ + event.cc \ + external_acl.cc \ + fd.cc \ + fde.cc \ + fde.h \ + filemap.cc \ + forward.cc \ + fqdncache.cc \ + ftp.cc \ + gopher.cc \ + helper.cc \ + $(HTCPSOURCE) \ + http.cc \ + HttpStatusLine.cc \ + HttpHdrCc.cc \ + HttpHdrRange.cc \ + HttpHdrSc.cc \ + HttpHdrScTarget.cc \ + HttpHdrContRange.cc \ + HttpHeader.cc \ + HttpHeaderTools.cc \ + HttpBody.cc \ + HttpMsg.cc \ + HttpReply.cc \ + HttpRequest.cc \ + HttpRequest.h \ + icmp.cc \ + icp_v2.cc \ + icp_v3.cc \ + $(IDENT_SOURCE) \ + internal.cc \ + ipc.cc \ + ipcache.cc \ + IPInterception.cc \ + IPInterception.h \ + $(LEAKFINDERSOURCE) \ + logfile.cc \ + mem.cc \ + mem_node.cc \ + mem_node.h \ + Mem.h \ + MemBuf.cc \ + MemObject.cc \ + MemObject.h \ + mime.cc \ + multicast.cc \ + neighbors.cc \ + net_db.cc \ + Packer.cc \ + $(XPROF_STATS_SOURCE) \ + pconn.cc \ + peer_digest.cc \ + peer_select.cc \ + protos.h \ + redirect.cc \ + referer.cc \ + refresh.cc \ + send-announce.cc \ + $(SNMPSOURCE) \ + squid.h \ + $(SSL_SOURCE) \ + tunnel.cc \ + SquidNew.cc \ + stat.cc \ + StatHist.cc \ + String.cc \ + stmem.cc \ + store_io.cc \ + StoreIOBuffer.h \ + StoreIOState.cc \ + store_client.cc \ + StoreClient.h \ + store_digest.cc \ + store_dir.cc \ + store_key_md5.cc \ + store_log.cc \ + store_rebuild.cc \ + store_swapin.cc \ + store_swapmeta.cc \ + store_swapout.cc \ + structs.h \ + SwapDir.cc \ + tools.cc \ + typedefs.h \ + ufscommon.cc \ + ufscommon.h \ + $(UNLINKDSOURCE) \ + url.cc \ + urn.cc \ + useragent.cc \ + wais.cc \ + wccp.cc \ + whois.cc \ + $(WIN32SOURCE) + ufsdump_LDADD = \ + -L../lib \ + @XTRA_OBJS@ \ + @REPL_OBJS@ \ + @STORE_OBJS@ \ + @AUTH_OBJS@ \ + @CRYPTLIB@ \ + @REGEXLIB@ \ + @SNMPLIB@ \ + @LIB_MALLOC@ \ + @SSLLIB@ \ + -lmiscutil \ + @XTRA_LIBS@ \ + @EPOLL_LIBS@ + ufsdump_DEPENDENCIES = $(top_builddir)/lib/libmiscutil.a + nodist_ufsdump_SOURCES = \ + repl_modules.cc \ + auth_modules.cc \ + store_modules.cc \ + cf_parser.h \ + globals.cc \ + string_arrays.c + + nodist_pinger_SOURCES = \ + globals.cc + + BUILT_SOURCES = \ + cf_gen_defines.h \ + cf_parser.h \ + globals.cc \ + string_arrays.c \ + repl_modules.cc \ + auth_modules.cc \ + store_modules.cc + + sysconf_DATA = \ + squid.conf.default \ + mime.conf.default + + data_DATA = \ + mib.txt + + LDADD = -L../lib -lmiscutil @XTRA_LIBS@ @EPOLL_LIBS@ + + EXTRA_DIST = \ + cf_gen_defines \ + cf.data.pre \ + mk-globals-c.pl \ + mk-string-arrays.pl \ + auth_modules.sh \ + store_modules.sh \ + repl_modules.sh \ + mib.txt \ + mime.conf.default + + DEFAULT_PREFIX = $(prefix) + DEFAULT_CONFIG_FILE = $(sysconfdir)/squid.conf + DEFAULT_MIME_TABLE = $(sysconfdir)/mime.conf + DEFAULT_DNSSERVER = $(libexecdir)/dnsserver$(EXEEXT) + DEFAULT_LOG_PREFIX = $(localstatedir)/logs + DEFAULT_CACHE_LOG = $(DEFAULT_LOG_PREFIX)/cache.log + DEFAULT_ACCESS_LOG = $(DEFAULT_LOG_PREFIX)/access.log + DEFAULT_STORE_LOG = $(DEFAULT_LOG_PREFIX)/store.log + DEFAULT_PID_FILE = $(DEFAULT_LOG_PREFIX)/squid.pid + DEFAULT_SWAP_DIR = $(localstatedir)/cache + DEFAULT_PINGER = $(libexecdir)/pinger$(EXEEXT) + DEFAULT_UNLINKD = $(libexecdir)/unlinkd$(EXEEXT) + DEFAULT_DISKD = $(libexecdir)/diskd$(EXEEXT) + DEFAULT_ICON_DIR = $(datadir)/icons + DEFAULT_ERROR_DIR = $(datadir)/errors/@ERR_DEFAULT_LANGUAGE@ + DEFAULT_MIB_PATH = $(datadir)/mib.txt + DEFAULT_HOSTS = @OPT_DEFAULT_HOSTS@ + + DEFS = @DEFS@ -DDEFAULT_CONFIG_FILE=\"$(DEFAULT_CONFIG_FILE)\" + + $(OBJS): $(top_srcdir)/include/version.h ../include/autoconf.h + + snmp_core.o snmp_agent.o: ../snmplib/libsnmp.a $(top_srcdir)/include/cache_snmp.h + + globals.cc: globals.h mk-globals-c.pl + $(PERL) $(srcdir)/mk-globals-c.pl < $(srcdir)/globals.h > $@ + + string_arrays.c: enums.h mk-string-arrays.pl + $(PERL) $(srcdir)/mk-string-arrays.pl < $(srcdir)/enums.h > $@ + + cache_diff: cache_diff.o debug.o globals.o store_key_md5.o + $(CC) -o $@ $(LDFLAGS) $@.o debug.o globals.o store_key_md5.o $(STD_APP_LIBS) + + test_cache_digest: test_cache_digest.o CacheDigest.o debug.o globals.o store_key_md5.o + $(CC) -o $@ $(LDFLAGS) $@.o CacheDigest.o debug.o globals.o store_key_md5.o $(STD_APP_LIBS) ## If autodependency works well this is not needed anymore -cache_cf.o: cf_parser.h + cache_cf.o: cf_parser.h -squid.conf.default: cf_parser.h - $(SHELL) -c "test -f squid.conf.default || ./cf_gen cf.data" + squid.conf.default: cf_parser.h + $(SHELL) -c "test -f squid.conf.default || ./cf_gen cf.data" -cf_parser.h: cf.data cf_gen$(EXEEXT) - ./cf_gen cf.data + cf_parser.h: cf.data cf_gen$(EXEEXT) + ./cf_gen cf.data -cf_gen_defines.h: $(srcdir)/cf_gen_defines $(srcdir)/cf.data.pre - awk -f $(srcdir)/cf_gen_defines <$(srcdir)/cf.data.pre >cf_gen_defines.h + cf_gen_defines.h: $(srcdir)/cf_gen_defines $(srcdir)/cf.data.pre + awk -f $(srcdir)/cf_gen_defines <$(srcdir)/cf.data.pre >cf_gen_defines.h ## FIXME: generate a sed command file from configure. Then this doesn't -## depend on the Makefile. -cf.data: cf.data.pre Makefile - sed "\ - s%@DEFAULT_MIME_TABLE@%$(DEFAULT_MIME_TABLE)%g;\ - s%@DEFAULT_DNSSERVER@%$(DEFAULT_DNSSERVER)%g;\ - s%@DEFAULT_UNLINKD@%$(DEFAULT_UNLINKD)%g;\ - s%@DEFAULT_PINGER@%$(DEFAULT_PINGER)%g;\ - s%@DEFAULT_DISKD@%$(DEFAULT_DISKD)%g;\ - s%@DEFAULT_CACHE_LOG@%$(DEFAULT_CACHE_LOG)%g;\ - s%@DEFAULT_ACCESS_LOG@%$(DEFAULT_ACCESS_LOG)%g;\ - s%@DEFAULT_STORE_LOG@%$(DEFAULT_STORE_LOG)%g;\ - s%@DEFAULT_PID_FILE@%$(DEFAULT_PID_FILE)%g;\ - s%@DEFAULT_SWAP_DIR@%$(DEFAULT_SWAP_DIR)%g;\ - s%@DEFAULT_ICON_DIR@%$(DEFAULT_ICON_DIR)%g;\ - s%@DEFAULT_MIB_PATH@%$(DEFAULT_MIB_PATH)%g;\ - s%@DEFAULT_ERROR_DIR@%$(DEFAULT_ERROR_DIR)%g;\ - s%@DEFAULT_PREFIX@%$(DEFAULT_PREFIX)%g;\ - s%@DEFAULT_HOSTS@%$(DEFAULT_HOSTS)%g;\ - s%@[V]ERSION@%$(VERSION)%g;"\ - < $(srcdir)/cf.data.pre >$@ - -store_modules.cc: store_modules.sh Makefile - $(SHELL) $(srcdir)/store_modules.sh $(STORE_MODULES) >store_modules.cc - -repl_modules.cc: repl_modules.sh Makefile - $(SHELL) $(srcdir)/repl_modules.sh $(REPL_POLICIES) > repl_modules.cc - -auth_modules.cc: auth_modules.sh Makefile - @$(SHELL) $(srcdir)/auth_modules.sh $(AUTH_MODULES) >auth_modules.cc - -install-data-local: install-sysconfDATA install-dataDATA - @if test -f $(DESTDIR)$(DEFAULT_MIME_TABLE) ; then \ - echo "$@ will not overwrite existing $(DESTDIR)$(DEFAULT_MIME_TABLE)" ; \ - else \ - echo "$(INSTALL_DATA) $(srcdir)/mime.conf.default $(DESTDIR)$(DEFAULT_MIME_TABLE)" ;\ - $(INSTALL_DATA) $(srcdir)/mime.conf.default $(DESTDIR)$(DEFAULT_MIME_TABLE); \ - fi - @if test -f $(DESTDIR)$(DEFAULT_CONFIG_FILE) ; then \ - echo "$@ will not overwrite existing $(DESTDIR)$(DEFAULT_CONFIG_FILE)" ; \ - else \ - echo "$(INSTALL_DATA) squid.conf.default $(DESTDIR)$(DEFAULT_CONFIG_FILE)"; \ - $(INSTALL_DATA) squid.conf.default $(DESTDIR)$(DEFAULT_CONFIG_FILE); \ - fi - $(mkinstalldirs) $(DESTDIR)$(DEFAULT_LOG_PREFIX) +## depend on the Makefile. + cf.data: cf.data.pre Makefile + sed "\ + s%@DEFAULT_MIME_TABLE@%$(DEFAULT_MIME_TABLE)%g; + + \ + s%@DEFAULT_DNSSERVER@%$(DEFAULT_DNSSERVER)%g; + + \ + s%@DEFAULT_UNLINKD@%$(DEFAULT_UNLINKD)%g; + + \ + s%@DEFAULT_PINGER@%$(DEFAULT_PINGER)%g; + + \ + s%@DEFAULT_DISKD@%$(DEFAULT_DISKD)%g; + + \ + s%@DEFAULT_CACHE_LOG@%$(DEFAULT_CACHE_LOG)%g; + + \ + s%@DEFAULT_ACCESS_LOG@%$(DEFAULT_ACCESS_LOG)%g; + + \ + s%@DEFAULT_STORE_LOG@%$(DEFAULT_STORE_LOG)%g; + + \ + s%@DEFAULT_PID_FILE@%$(DEFAULT_PID_FILE)%g; + + \ + s%@DEFAULT_SWAP_DIR@%$(DEFAULT_SWAP_DIR)%g; + + \ + s%@DEFAULT_ICON_DIR@%$(DEFAULT_ICON_DIR)%g; + + \ + s%@DEFAULT_MIB_PATH@%$(DEFAULT_MIB_PATH)%g; + + \ + s%@DEFAULT_ERROR_DIR@%$(DEFAULT_ERROR_DIR)%g; + + \ + s%@DEFAULT_PREFIX@%$(DEFAULT_PREFIX)%g; + + \ + s%@DEFAULT_HOSTS@%$(DEFAULT_HOSTS)%g; + + \ + s%@[V]ERSION@%$(VERSION)%g;"\ + + < $(srcdir)/cf.data.pre >$@ + + store_modules.cc: store_modules.sh Makefile + $(SHELL) $(srcdir)/store_modules.sh $(STORE_MODULES) >store_modules.cc + + repl_modules.cc: repl_modules.sh Makefile + $(SHELL) $(srcdir)/repl_modules.sh $(REPL_POLICIES) > repl_modules.cc + + auth_modules.cc: auth_modules.sh Makefile + @$(SHELL) $(srcdir)/auth_modules.sh $(AUTH_MODULES) >auth_modules.cc + + install-data-local: install-sysconfDATA install-dataDATA + @if test -f $(DESTDIR)$(DEFAULT_MIME_TABLE) ; then \ +echo " +$@ will not overwrite existing $(DESTDIR)$(DEFAULT_MIME_TABLE)" ; \ +else \ + echo "$(INSTALL_DATA) $(srcdir)/mime.conf.default $(DESTDIR)$(DEFAULT_MIME_TABLE)" ;\ +$(INSTALL_DATA) $(srcdir)/mime.conf.default $(DESTDIR)$(DEFAULT_MIME_TABLE); \ +fi +@if test -f $(DESTDIR)$(DEFAULT_CONFIG_FILE) ; then \ +echo "$@ will not overwrite existing $(DESTDIR)$(DEFAULT_CONFIG_FILE)" ; \ +else \ + echo "$(INSTALL_DATA) squid.conf.default $(DESTDIR)$(DEFAULT_CONFIG_FILE)"; \ +$(INSTALL_DATA) squid.conf.default $(DESTDIR)$(DEFAULT_CONFIG_FILE); \ +fi +$(mkinstalldirs) $(DESTDIR)$(DEFAULT_LOG_PREFIX) uninstall-local: - @if test -f $(DESTDIR)$(DEFAULT_MIME_TABLE) ; then \ - echo "rm -f $(DESTDIR)$(DEFAULT_MIME_TABLE)"; \ - $(RM) -f $(DESTDIR)$(DEFAULT_MIME_TABLE); \ - fi +@if test -f $(DESTDIR)$(DEFAULT_MIME_TABLE) ; then \ +echo "rm -f $(DESTDIR)$(DEFAULT_MIME_TABLE)"; \ +$(RM) -f $(DESTDIR)$(DEFAULT_MIME_TABLE); \ +fi # Don't automatically uninstall config files # @if test -f $(DESTDIR)$(DEFAULT_CONFIG_FILE) ; then \ @@ -791,7 +825,7 @@ uninstall-local: # fi DISTCLEANFILES = cf_gen_defines.h cf.data cf_parser.h squid.conf.default \ - globals.cc string_arrays.c repl_modules.cc auth_modules.cc store_modules.cc + globals.cc string_arrays.c repl_modules.cc auth_modules.cc store_modules.cc ##install-pinger: ## @f=$(PINGER_EXE); \ diff --git a/src/StoreSwapLogData.cc b/src/StoreSwapLogData.cc new file mode 100644 index 0000000000..e0a8f6a455 --- /dev/null +++ b/src/StoreSwapLogData.cc @@ -0,0 +1,66 @@ +/* + * $Id: StoreSwapLogData.cc,v 1.1 2003/07/15 11:33:21 robertc Exp $ + * + * DEBUG: section 47 Store Directory Routines + * 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 "StoreSwapLogData.h" + +StoreSwapLogData::StoreSwapLogData(): op(0), swap_filen (0), timestamp (0), lastref (0), expires (0), lastmod(0), swap_file_sz (0), refcount (0), flags (0) +{ + memset (key, '\0', sizeof(key)); +} + +MemPool (*StoreSwapLogData::Pool)(NULL); + +void * +StoreSwapLogData::operator new (size_t byteCount) +{ + /* derived classes with different sizes must implement their own new */ + assert (byteCount == sizeof (StoreSwapLogData)); + + if (!Pool) + Pool = memPoolCreate("StoreSwapLogData", sizeof (StoreSwapLogData)); + + return memPoolAlloc(Pool); +} + +void +StoreSwapLogData::operator delete (void *address) +{ + memPoolFree (Pool, address); +} + +void +StoreSwapLogData::deleteSelf() const +{ + delete this; +} diff --git a/src/StoreSwapLogData.h b/src/StoreSwapLogData.h new file mode 100644 index 0000000000..338cd70784 --- /dev/null +++ b/src/StoreSwapLogData.h @@ -0,0 +1,71 @@ + +/* + * $Id: StoreSwapLogData.h,v 1.1 2003/07/15 11:33:21 robertc Exp $ + * + * 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. + * + * Copyright (c) 2003, Robert Collins + */ + +#ifndef SQUID_STORESWAPLOGDATA_H +#define SQUID_STORESWAPLOGDATA_H + +#include "squid.h" + +/* + * Do we need to have the dirn in here? I don't think so, since we already + * know the dirn .. + */ +/* Binary format on disk. + * DO NOT randomly alter. + * DO NOT add ANY virtual's. + */ + +class StoreSwapLogData +{ + +public: + void *operator new (size_t byteCount); + void operator delete (void *address); + void deleteSelf() const; + StoreSwapLogData(); + char op; + sfileno swap_filen; + time_t timestamp; + time_t lastref; + time_t expires; + time_t lastmod; + size_t swap_file_sz; + u_short refcount; + u_short flags; + unsigned char key[MD5_DIGEST_CHARS]; + +private: + static MemPool *Pool; +}; + +#endif /* SQUID_STORESWAPLOGDATA_H */ diff --git a/src/cache_diff.cc b/src/cache_diff.cc index 38b2ea01ce..5b3ac42515 100644 --- a/src/cache_diff.cc +++ b/src/cache_diff.cc @@ -1,6 +1,6 @@ /* - * $Id: cache_diff.cc,v 1.19 2003/04/24 06:35:08 hno Exp $ + * $Id: cache_diff.cc,v 1.20 2003/07/15 11:33:22 robertc Exp $ * * AUTHOR: Alex Rousskov * @@ -58,7 +58,7 @@ typedef struct _CacheEntry const cache_key *key; struct _CacheEntry *next; - /* storeSwapLogData s; */ + /* StoreSwapLogData s; */ unsigned char key_arr[MD5_DIGEST_CHARS]; } @@ -83,7 +83,7 @@ static int cacheIndexScan(CacheIndex * idx, const char *fname, FILE * file); static CacheEntry * -cacheEntryCreate(const storeSwapLogData * s) +cacheEntryCreate(const StoreSwapLogData * s) { CacheEntry *e = xcalloc(1, sizeof(CacheEntry)); assert(s); @@ -181,7 +181,7 @@ static int cacheIndexScan(CacheIndex * idx, const char *fname, FILE * file) { int count = 0; - storeSwapLogData s; + StoreSwapLogData s; fprintf(stderr, "%s scanning\n", fname); while (fread(&s, sizeof(s), 1, file) == 1) { diff --git a/src/enums.h b/src/enums.h index 3ee6af86ba..3f01415648 100644 --- a/src/enums.h +++ b/src/enums.h @@ -1,6 +1,6 @@ /* - * $Id: enums.h,v 1.232 2003/07/06 21:50:56 hno Exp $ + * $Id: enums.h,v 1.233 2003/07/15 11:33:22 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -558,8 +558,6 @@ typedef enum { MEM_DWRITE_Q, MEM_FQDNCACHE_ENTRY, MEM_FWD_SERVER, - MEM_HELPER_REQUEST, - MEM_HELPER_STATEFUL_REQUEST, MEM_HTTP_HDR_CC, MEM_HTTP_HDR_CONTENT_RANGE, MEM_HTTP_HDR_SC, @@ -569,13 +567,11 @@ typedef enum { MEM_NETDBENTRY, MEM_NET_DB_NAME, MEM_RELIST, - MEM_REQUEST_T, MEM_WORDLIST, #if !USE_DNSSERVERS MEM_IDNS_QUERY, #endif MEM_EVENT, - MEM_SWAP_LOG_DATA, MEM_MAX } mem_type; diff --git a/src/fs/coss/store_dir_coss.cc b/src/fs/coss/store_dir_coss.cc index a576423716..ae112af7d8 100644 --- a/src/fs/coss/store_dir_coss.cc +++ b/src/fs/coss/store_dir_coss.cc @@ -1,6 +1,6 @@ /* - * $Id: store_dir_coss.cc,v 1.44 2003/02/21 22:50:39 robertc Exp $ + * $Id: store_dir_coss.cc,v 1.45 2003/07/15 11:33:23 robertc Exp $ * * DEBUG: section 47 Store COSS Directory Routines * AUTHOR: Eric Stern @@ -41,6 +41,7 @@ #include "store_coss.h" #include "fde.h" #include "SwapDir.h" +#include "StoreSwapLogData.h" #define STORE_META_BUFSZ 4096 @@ -211,8 +212,8 @@ storeCossRebuildFromSwapLog(void *data) { RebuildState *rb = (RebuildState *)data; StoreEntry *e = NULL; - storeSwapLogData s; - size_t ss = sizeof(storeSwapLogData); + StoreSwapLogData s; + size_t ss = sizeof(StoreSwapLogData); double x; assert(rb != NULL); /* load a number of objects per invocation */ @@ -600,9 +601,8 @@ void CossCleanLog::write(StoreEntry const &e) { CossCleanLog *state = this; - storeSwapLogData s; - static size_t ss = sizeof(storeSwapLogData); - memset(&s, '\0', ss); + StoreSwapLogData s; + static size_t ss = sizeof(StoreSwapLogData); s.op = (char) SWAP_LOG_ADD; s.swap_filen = e.swap_filen; s.timestamp = e.timestamp; @@ -704,16 +704,10 @@ CossSwapDir::writeCleanDone() cleanLog = NULL; } -static void -storeSwapLogDataFree(void *s) -{ - memFree(s, MEM_SWAP_LOG_DATA); -} - void CossSwapDir::logEntry(const StoreEntry & e, int op) const { - storeSwapLogData *s = (storeSwapLogData *)memAllocate(MEM_SWAP_LOG_DATA); + StoreSwapLogData *s = new StoreSwapLogData; s->op = (char) op; s->swap_filen = e.swap_filen; s->timestamp = e.timestamp; @@ -727,10 +721,10 @@ CossSwapDir::logEntry(const StoreEntry & e, int op) const file_write(swaplog_fd, -1, s, - sizeof(storeSwapLogData), + sizeof(StoreSwapLogData), NULL, NULL, - (FREE *) storeSwapLogDataFree); + &FreeObject); } void diff --git a/src/fs/ufs/store_dir_ufs.cc b/src/fs/ufs/store_dir_ufs.cc index 74b82e524d..813c7bd221 100644 --- a/src/fs/ufs/store_dir_ufs.cc +++ b/src/fs/ufs/store_dir_ufs.cc @@ -1,6 +1,6 @@ /* - * $Id: store_dir_ufs.cc,v 1.58 2003/04/24 06:35:10 hno Exp $ + * $Id: store_dir_ufs.cc,v 1.59 2003/07/15 11:33:23 robertc Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -38,6 +38,7 @@ #include "fde.h" #include "store_ufs.h" #include "ufscommon.h" +#include "StoreSwapLogData.h" #include "SwapDir.h" static int ufs_initialised = 0; @@ -950,9 +951,8 @@ UFSCleanLog::nextEntry() void UFSCleanLog::write(StoreEntry const &e) { - storeSwapLogData s; - static size_t ss = sizeof(storeSwapLogData); - memset(&s, '\0', ss); + StoreSwapLogData s; + static size_t ss = sizeof(StoreSwapLogData); s.op = (char) SWAP_LOG_ADD; s.swap_filen = e.swap_filen; s.timestamp = e.timestamp; @@ -1058,16 +1058,10 @@ UFSSwapDir::writeCleanDone() cleanLog = NULL; } -void -storeSwapLogDataFree(void *s) -{ - memFree(s, MEM_SWAP_LOG_DATA); -} - void UFSSwapDir::logEntry(const StoreEntry & e, int op) const { - storeSwapLogData *s = (storeSwapLogData *)memAllocate(MEM_SWAP_LOG_DATA); + StoreSwapLogData *s = new StoreSwapLogData; s->op = (char) op; s->swap_filen = e.swap_filen; s->timestamp = e.timestamp; @@ -1081,10 +1075,10 @@ UFSSwapDir::logEntry(const StoreEntry & e, int op) const file_write(swaplog_fd, -1, s, - sizeof(storeSwapLogData), + sizeof(StoreSwapLogData), NULL, NULL, - (FREE *) storeSwapLogDataFree); + FreeObject); } static QS rev_int_sort; diff --git a/src/helper.cc b/src/helper.cc index 3832f7d3c1..24e7d849aa 100644 --- a/src/helper.cc +++ b/src/helper.cc @@ -1,6 +1,6 @@ /* - * $Id: helper.cc,v 1.58 2003/05/29 15:54:08 hno Exp $ + * $Id: helper.cc,v 1.59 2003/07/15 11:33:22 robertc Exp $ * * DEBUG: section 84 Helper process maintenance * AUTHOR: Harvest Derived? @@ -34,6 +34,7 @@ */ #include "squid.h" +#include "helper.h" #include "Store.h" #include "comm.h" @@ -265,7 +266,7 @@ helperStatefulOpenServers(statefulhelper * hlp) void helperSubmit(helper * hlp, const char *buf, HLPCB * callback, void *data) { - helper_request *r = (helper_request *)memAllocate(MEM_HELPER_REQUEST); + helper_request *r = new helper_request; helper_server *srv; if (hlp == NULL) { @@ -292,7 +293,7 @@ helperSubmit(helper * hlp, const char *buf, HLPCB * callback, void *data) void helperStatefulSubmit(statefulhelper * hlp, const char *buf, HLPSCB * callback, void *data, helper_stateful_server * lastserver) { - helper_stateful_request *r = (helper_stateful_request *)memAllocate(MEM_HELPER_STATEFUL_REQUEST); + helper_stateful_request *r = new helper_stateful_request; helper_stateful_server *srv; if (hlp == NULL) { @@ -1451,7 +1452,33 @@ helperRequestFree(helper_request * r) { cbdataReferenceDone(r->data); xfree(r->buf); - memFree(r, MEM_HELPER_REQUEST); + r->deleteSelf(); +} + +MemPool (*helper_request::Pool)(NULL); + +void * +helper_request::operator new (size_t byteCount) +{ + /* derived classes with different sizes must implement their own new */ + assert (byteCount == sizeof (helper_request)); + + if (!Pool) + Pool = memPoolCreate("helper_request", sizeof (helper_request)); + + return memPoolAlloc(Pool); +} + +void +helper_request::operator delete (void *address) +{ + memPoolFree (Pool, address); +} + +void +helper_request::deleteSelf() const +{ + delete this; } static void @@ -1459,5 +1486,31 @@ helperStatefulRequestFree(helper_stateful_request * r) { cbdataReferenceDone(r->data); xfree(r->buf); - memFree(r, MEM_HELPER_STATEFUL_REQUEST); + r->deleteSelf(); +} + +MemPool (*helper_stateful_request::Pool)(NULL); + +void * +helper_stateful_request::operator new (size_t byteCount) +{ + /* derived classes with different sizes must implement their own new */ + assert (byteCount == sizeof (helper_stateful_request)); + + if (!Pool) + Pool = memPoolCreate("helper_stateful_request", sizeof (helper_stateful_request)); + + return memPoolAlloc(Pool); +} + +void +helper_stateful_request::operator delete (void *address) +{ + memPoolFree (Pool, address); +} + +void +helper_stateful_request::deleteSelf() const +{ + delete this; } diff --git a/src/helper.h b/src/helper.h new file mode 100644 index 0000000000..dc107978d4 --- /dev/null +++ b/src/helper.h @@ -0,0 +1,74 @@ + +/* + * $Id: helper.h,v 1.1 2003/07/15 11:33:21 robertc Exp $ + * + * DEBUG: section 84 Helper process maintenance + * AUTHOR: Harvest Derived? + * + * 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. + * + */ + +#ifndef SQUID_HELPER_H +#define SQUID_HELPER_H + +#include "squid.h" + +class helper_request +{ + +public: + void *operator new(size_t); + void operator delete (void *); + void deleteSelf() const; + char *buf; + HLPCB *callback; + void *data; + + struct timeval dispatch_time; + +private: + static MemPool *Pool; +}; + +class helper_stateful_request +{ + +public: + void *operator new(size_t); + void operator delete (void *); + void deleteSelf() const; + char *buf; + HLPSCB *callback; + int placeholder; /* if 1, this is a dummy request waiting for a stateful helper to become available for deferred requests.*/ + void *data; + +private: + static MemPool *Pool; +}; + +#endif /* SQUID_HELPER_H */ diff --git a/src/mem.cc b/src/mem.cc index 92426faa14..9a4977e298 100644 --- a/src/mem.cc +++ b/src/mem.cc @@ -1,6 +1,6 @@ /* - * $Id: mem.cc,v 1.81 2003/07/14 14:16:00 robertc Exp $ + * $Id: mem.cc,v 1.82 2003/07/15 11:33:22 robertc Exp $ * * DEBUG: section 13 High Level Memory Pool Management * AUTHOR: Harvest Derived @@ -37,7 +37,6 @@ #include "Mem.h" #include "memMeter.h" #include "Store.h" -#include "HttpRequest.h" /* module globals */ @@ -363,7 +362,6 @@ memConfigure(void) /* XXX make these classes do their own memory management */ #include "HttpHdrContRange.h" -#include "HttpRequest.h" void Mem::Init(void) @@ -409,17 +407,10 @@ Mem::Init(void) memDataInit(MEM_NETDBENTRY, "netdbEntry", sizeof(netdbEntry), 0); memDataInit(MEM_NET_DB_NAME, "net_db_name", sizeof(net_db_name), 0); memDataInit(MEM_RELIST, "relist", sizeof(relist), 0); - memDataInit(MEM_REQUEST_T, "request_t", sizeof(request_t), - Squid_MaxFD >> 3); memDataInit(MEM_WORDLIST, "wordlist", sizeof(wordlist), 0); memDataInit(MEM_CLIENT_INFO, "ClientInfo", sizeof(ClientInfo), 0); memDataInit(MEM_MD5_DIGEST, "MD5 digest", MD5_DIGEST_CHARS, 0); memPoolSetChunkSize(MemPools[MEM_MD5_DIGEST], 512 * 1024); - memDataInit(MEM_HELPER_REQUEST, "helper_request", - sizeof(helper_request), 0); - memDataInit(MEM_HELPER_STATEFUL_REQUEST, "helper_stateful_request", - sizeof(helper_stateful_request), 0); - memDataInit(MEM_SWAP_LOG_DATA, "storeSwapLogData", sizeof(storeSwapLogData), 0); /* init string pools */ diff --git a/src/protos.h b/src/protos.h index 47710d5291..055a3b70de 100644 --- a/src/protos.h +++ b/src/protos.h @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.483 2003/07/15 06:50:42 robertc Exp $ + * $Id: protos.h,v 1.484 2003/07/15 11:33:22 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -204,6 +204,16 @@ SQUIDCEXTERN void debugObj(int section, int level, const char *label, void *obj, /* disk.c */ SQUIDCEXTERN int file_open(const char *path, int mode); SQUIDCEXTERN void file_close(int fd); +/* Adapter file_write for object callbacks */ + +template +void +FreeObject(void *address) +{ + O *anObject = static_cast (address); + anObject->deleteSelf(); +} + SQUIDCEXTERN void file_write(int, off_t, void const *, int len, DWCB *, void *, FREE *); SQUIDCEXTERN void file_write_mbuf(int fd, off_t, MemBuf mb, DWCB * handler, void *handler_data); SQUIDCEXTERN void file_read(int, char *, int, off_t, DRCB *, void *); diff --git a/src/structs.h b/src/structs.h index bbae3e78da..a5f609a4d5 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.473 2003/07/15 06:50:42 robertc Exp $ + * $Id: structs.h,v 1.474 2003/07/15 11:33:22 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -1917,24 +1917,6 @@ struct _HttpHeaderStat int busyDestroyedCount; }; -/* - * Do we need to have the dirn in here? I don't think so, since we already - * know the dirn .. - */ - -struct _storeSwapLogData -{ - char op; - sfileno swap_filen; - time_t timestamp; - time_t lastref; - time_t expires; - time_t lastmod; - size_t swap_file_sz; - u_short refcount; - u_short flags; - unsigned char key[MD5_DIGEST_CHARS]; -}; struct _ClientInfo { @@ -2010,24 +1992,7 @@ unsigned int ftp_pasv_failed: flags; }; - -struct _helper_request -{ - char *buf; - HLPCB *callback; - void *data; - - struct timeval dispatch_time; -}; - -struct _helper_stateful_request -{ - char *buf; - HLPSCB *callback; - int placeholder; /* if 1, this is a dummy request waiting for a stateful helper to become available for deferred requests.*/ - void *data; -}; - +class helper_request; struct _helper { @@ -2120,6 +2085,7 @@ unsigned int shutdown: stats; }; +class helper_stateful_request; struct _helper_stateful_server { diff --git a/src/typedefs.h b/src/typedefs.h index 90d5690112..4d38215c50 100644 --- a/src/typedefs.h +++ b/src/typedefs.h @@ -1,6 +1,6 @@ /* - * $Id: typedefs.h,v 1.166 2003/07/15 06:50:43 robertc Exp $ + * $Id: typedefs.h,v 1.167 2003/07/15 11:33:22 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -245,10 +245,6 @@ typedef struct _helper_server helper_server; typedef struct _helper_stateful_server helper_stateful_server; -typedef struct _helper_request helper_request; - -typedef struct _helper_stateful_request helper_stateful_request; - typedef struct _generic_cbdata generic_cbdata; class storeIOState; diff --git a/src/ufscommon.cc b/src/ufscommon.cc index dd00c3c4be..ebd8deee1c 100644 --- a/src/ufscommon.cc +++ b/src/ufscommon.cc @@ -1,8 +1,8 @@ /* - * $Id: ufscommon.cc,v 1.9 2003/02/21 22:50:12 robertc Exp $ + * $Id: ufscommon.cc,v 1.10 2003/07/15 11:33:22 robertc Exp $ * * DEBUG: section 47 Store Directory Routines - * AUTHOR: Duane Wessels + * AUTHOR: Robert Collins * * SQUID Web Proxy Cache http://www.squid-cache.org/ * ---------------------------------------------------------- @@ -30,6 +30,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * + * Copyright (c) 2003, Robert Collins */ #include "ufscommon.h" @@ -39,6 +40,7 @@ #include "Generic.h" #include "StoreMetaUnpacker.h" #include "RefCount.h" +#include "StoreSwapLogData.h" CBDATA_CLASS_INIT(RebuildState); @@ -293,8 +295,8 @@ RebuildState::rebuildFromSwapLog() /* load a number of objects per invocation */ for (int count = 0; count < speed; count++) { - storeSwapLogData s; - size_t ss = sizeof(storeSwapLogData); + StoreSwapLogData s; + size_t ss = sizeof(StoreSwapLogData); if (fread(&s, ss, 1, log) != 1) { debug(47, 1) ("Done reading %s swaplog (%d entries)\n", diff --git a/src/ufscommon.h b/src/ufscommon.h index fd1e443ca2..8b471cc6d4 100644 --- a/src/ufscommon.h +++ b/src/ufscommon.h @@ -1,6 +1,6 @@ /* - * $Id: ufscommon.h,v 1.5 2003/02/21 22:50:12 robertc Exp $ + * $Id: ufscommon.h,v 1.6 2003/07/15 11:33:22 robertc Exp $ * * SQUID Web Proxy Cache http://www.squid-cache.org/ * ---------------------------------------------------------- @@ -40,7 +40,6 @@ #define STORE_META_BUFSZ 4096 /* Common UFS routines */ -FREE storeSwapLogDataFree; #include "SwapDir.h" class UFSStrategy;