#if USE_SQUID_ESI && HAVE_LIBEXPAT
+#include "base/RunnersRegistry.h"
#include "esi/ExpatParser.h"
+#include <memory>
+
+namespace Esi
+{
+
+class ExpatRr : public RegisteredRunner
+{
+public:
+ void finalizeConfig()
+ {
+ registration.reset(new ESIParser::Register("expat", &ESIExpatParser::NewParser));
+ }
+
+private:
+ std::unique_ptr<ESIParser::Register> registration;
+};
+
+RunnerRegistrationEntry(ExpatRr);
+
+}
+
EsiParserDefinition(ESIExpatParser);
ESIExpatParser::ESIExpatParser(ESIParserClient *aClient) : theClient (aClient)
#if USE_SQUID_ESI && HAVE_LIBXML2
+#include "base/RunnersRegistry.h"
#include "esi/Libxml2Parser.h"
+#include <memory>
+
+namespace Esi
+{
+
+class Libxml2Rr : public RegisteredRunner
+{
+public:
+ void finalizeConfig()
+ {
+ registration.reset(new ESIParser::Register("libxml2", &ESILibxml2Parser::NewParser));
+ }
+
+private:
+ std::unique_ptr<ESIParser::Register> registration;
+};
+
+RunnerRegistrationEntry(Libxml2Rr);
+
+}
+
// the global document that will store the resolved entity
// definitions
static htmlDocPtr entity_doc = NULL;
Include.cc \
Include.h \
Literal.h \
- Module.cc \
- Module.h \
Parser.cc \
Parser.h \
Segment.cc \
+++ /dev/null
-/*
- * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
- *
- * Squid software is distributed under GPLv2+ license and includes
- * contributions from numerous individuals and organizations.
- * Please see the COPYING and CONTRIBUTORS files for details.
- */
-
-#include "squid.h"
-#include "esi/Libxml2Parser.h"
-#include "esi/Module.h"
-/* include for esi/ExpatParser.h must follow esi/Libxml2Parser.h */
-/* do not remove this comment, as it acts as barrier for the autmatic sorting */
-#include "esi/ExpatParser.h"
-
-#if HAVE_LIBXML2
-static ESIParser::Register *prLibxml = 0;
-#endif
-#if HAVE_LIBEXPAT
-static ESIParser::Register *prExpat = 0;
-#endif
-
-void Esi::Init()
-{
-#if HAVE_LIBEXPAT
- assert(!prExpat); // we should be called once
- prExpat = new ESIParser::Register("expat", &ESIExpatParser::NewParser);
-#endif
-
-#if HAVE_LIBXML2
- assert(!prLibxml); // we should be called once
- prLibxml = new ESIParser::Register("libxml2", &ESILibxml2Parser::NewParser);
-#endif
-}
-
-void Esi::Clean()
-{
-#if HAVE_LIBEXPAT
- delete prExpat;
- prExpat = NULL;
-#endif
-
-#if HAVE_LIBXML2
- delete prLibxml;
- prLibxml = NULL;
-#endif
-}
-
+++ /dev/null
-/*
- * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
- *
- * Squid software is distributed under GPLv2+ license and includes
- * contributions from numerous individuals and organizations.
- * Please see the COPYING and CONTRIBUTORS files for details.
- */
-
-#ifndef SQUID_ESI_MODULE_H
-#define SQUID_ESI_MODULE_H
-
-namespace Esi
-{
-
-void Init();
-void Clean();
-
-} // namespace Esi
-
-#endif /* SQUID_ESI_MODULE_H */
-
#if USE_ADAPTATION
#include "adaptation/Config.h"
#endif
-#if USE_SQUID_ESI
-#include "esi/Module.h"
-#endif
#if SQUID_SNMP
#include "snmp_core.h"
#endif
Adaptation::Config::Finalize(enableAdaptation);
#endif
-#if USE_SQUID_ESI
- Esi::Init();
-#endif
-
#if USE_DELAY_POOLS
Config.ClientDelay.finalize();
#endif
releaseServerSockets();
commCloseAllSockets();
-#if USE_SQUID_ESI
- Esi::Clean();
-#endif
-
#if USE_DELAY_POOLS
DelayPools::FreePools();
#endif