Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2578,6 +2578,7 @@ AC_CONFIG_FILES([
src/DiskIO/DiskThreads/Makefile
src/DiskIO/IpcIo/Makefile
src/DiskIO/Mmapped/Makefile
src/engines/Makefile
src/error/Makefile
src/eui/Makefile
src/format/Makefile
Expand Down
96 changes: 0 additions & 96 deletions src/EventLoop.h

This file was deleted.

50 changes: 25 additions & 25 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ SUBDIRS = \
time \
debug \
base \
engines \
anyp \
helper \
dns \
Expand Down Expand Up @@ -214,8 +215,6 @@ squid_SOURCES = \
$(WINSVC_SOURCE) \
AccessLogEntry.cc \
AccessLogEntry.h \
AsyncEngine.cc \
AsyncEngine.h \
AuthReg.h \
BodyPipe.cc \
BodyPipe.h \
Expand Down Expand Up @@ -246,8 +245,6 @@ squid_SOURCES = \
Downloader.h \
ETag.cc \
ETag.h \
EventLoop.cc \
EventLoop.h \
ExternalACL.h \
ExternalACLEntry.cc \
ExternalACLEntry.h \
Expand Down Expand Up @@ -536,6 +533,7 @@ squid_LDADD = \
$(ADAPTATION_LIBS) \
html/libhtml.la \
$(SNMP_LIBS) \
engines/libengines.la \
mem/libmem.la \
store/libstore.la \
time/libtime.la \
Expand Down Expand Up @@ -998,6 +996,24 @@ tests_testString_LDADD = \
$(XTRA_LIBS)
tests_testString_LDFLAGS = $(LIBADD_DL)

# Tests of engines/*

check_PROGRAMS += tests/testEventLoop
tests_testEventLoop_SOURCES = \
tests/testEventLoop.cc
nodist_tests_testEventLoop_SOURCES = \
tests/stub_SBuf.cc \
tests/stub_debug.cc \
tests/stub_fatal.cc \
tests/stub_libtime.cc
tests_testEventLoop_LDADD = \
engines/libengines.la \
base/libbase.la \
$(LIBCPPUNIT_LIBS) \
$(COMPAT_LIB) \
$(XTRA_LIBS)
tests_testEventLoop_LDFLAGS = $(LIBADD_DL)

## Tests of fs/*

if ENABLE_FS_ROCK
Expand All @@ -1015,7 +1031,6 @@ tests_testRock_SOURCES = \
ConfigOption.cc \
ConfigParser.cc \
ETag.cc \
EventLoop.cc \
FadingCounter.cc \
FileMap.h \
tests/stub_HelperChildConfig.cc \
Expand Down Expand Up @@ -1146,6 +1161,7 @@ tests_testRock_LDADD = \
$(SSL_LIBS) \
ipc/libipc.la \
base/libbase.la \
engines/libengines.la \
mem/libmem.la \
store/libstore.la \
$(ADAPTATION_LIBS) \
Expand Down Expand Up @@ -1185,7 +1201,6 @@ tests_testUfs_SOURCES = \
ConfigOption.cc \
ConfigParser.cc \
ETag.cc \
EventLoop.cc \
FadingCounter.cc \
FileMap.h \
tests/stub_HelperChildConfig.cc \
Expand Down Expand Up @@ -1323,6 +1338,7 @@ tests_testUfs_LDADD = \
comm/libcomm.la \
dns/libdns.la \
base/libbase.la \
engines/libengines.la \
mem/libmem.la \
store/libstore.la \
$(ADAPTATION_LIBS) \
Expand Down Expand Up @@ -1359,7 +1375,6 @@ tests_testStore_SOURCES = \
ConfigOption.cc \
ConfigParser.cc \
ETag.cc \
EventLoop.cc \
FileMap.h \
tests/stub_HelperChildConfig.cc \
HttpBody.cc \
Expand Down Expand Up @@ -1486,6 +1501,7 @@ tests_testStore_LDADD= \
fs/libfs.la \
mgr/libmgr.la \
anyp/libanyp.la \
engines/libengines.la \
mem/libmem.la \
store/libstore.la \
sbuf/libsbuf.la \
Expand Down Expand Up @@ -1522,7 +1538,6 @@ tests_testDiskIO_SOURCES = \
ConfigParser.cc \
tests/testDiskIO.cc \
tests/stub_ETag.cc \
EventLoop.cc \
FadingCounter.cc \
FileMap.h \
tests/stub_HelperChildConfig.cc \
Expand Down Expand Up @@ -1666,6 +1681,7 @@ tests_testDiskIO_LDADD = \
ipc/libipc.la \
dns/libdns.la \
base/libbase.la \
engines/libengines.la \
mem/libmem.la \
sbuf/libsbuf.la \
$(top_builddir)/lib/libmisccontainers.la \
Expand Down Expand Up @@ -2080,7 +2096,6 @@ tests_testCacheManager_SOURCES = \
CpuAffinitySet.cc \
CpuAffinitySet.h \
tests/stub_ETag.cc \
tests/stub_EventLoop.cc \
ExternalACLEntry.cc \
FadingCounter.cc \
FileMap.h \
Expand Down Expand Up @@ -2183,6 +2198,7 @@ tests_testCacheManager_SOURCES = \
tests/stub_libauth.cc \
tests/stub_libauth_acls.cc \
tests/stub_libdiskio.cc \
tests/stub_libengines.cc \
tests/stub_liberror.cc \
tests/stub_libsecurity.cc \
tests/stub_main_cc.cc \
Expand Down Expand Up @@ -2375,22 +2391,6 @@ tests_testEvent_LDADD = \
$(XTRA_LIBS)
tests_testEvent_LDFLAGS = $(LIBADD_DL)

check_PROGRAMS += tests/testEventLoop
tests_testEventLoop_SOURCES = \
tests/testEventLoop.cc
nodist_tests_testEventLoop_SOURCES = \
EventLoop.cc \
tests/stub_SBuf.cc \
tests/stub_debug.cc \
tests/stub_fatal.cc \
tests/stub_libtime.cc
tests_testEventLoop_LDADD = \
base/libbase.la \
$(LIBCPPUNIT_LIBS) \
$(COMPAT_LIB) \
$(XTRA_LIBS)
tests_testEventLoop_LDFLAGS = $(LIBADD_DL)

check_PROGRAMS += tests/testIoManip
tests_testIoManip_SOURCES = \
tests/testIoManip.cc
Expand Down
3 changes: 1 addition & 2 deletions src/adaptation/ecap/ServiceRep.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
#include "adaptation/ecap/Host.h"
#include "adaptation/ecap/ServiceRep.h"
#include "adaptation/ecap/XactionRep.h"
#include "AsyncEngine.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not remove a header declaring a class that is used by the including code, even if some other included header happens to include that class declaration today. The same concern probably applies to some other modified files as well.

#include "base/TextException.h"
#include "debug/Stream.h"
#include "EventLoop.h"
#include "engines/EventLoop.h"

#if HAVE_LIBECAP_ADAPTER_SERVICE_H
#include <libecap/adapter/service.h>
Expand Down
26 changes: 12 additions & 14 deletions src/AsyncEngine.h → src/engines/AsyncEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,54 +6,52 @@
* Please see the COPYING and CONTRIBUTORS files for details.
*/

#ifndef SQUID_SRC_ASYNCENGINE_H
#define SQUID_SRC_ASYNCENGINE_H
#ifndef SQUID_SRC_ENGINES_ASYNCENGINE_H
#define SQUID_SRC_ENGINES_ASYNCENGINE_H

/* Abstract interface for async engines which an event loop can utilise.
/**
* Abstract interface for async engines which an event loop can utilise.
*
* Some implementations will be truly async, others like the event engine
* will be pseudo async.
*/

class AsyncEngine
{

public:
/* error codes returned from checkEvents. If the return value is not
* negative, then it is the requested delay until the next call. If it is
* negative, it is one of the following codes:
*/
enum CheckError {
/* this engine is completely idle: it has no pending events, and nothing
* registered with it that can create events
*/
/// This engine is completely idle: it has no pending events, and nothing
/// registered with it that can create events.
EVENT_IDLE = -1,
/* some error has occurred in this engine */
/// Some error has occurred in this engine.
EVENT_ERROR = -2
};

virtual ~AsyncEngine() {}

/* Check the engine for events. If there are events that have completed,
/**
* Check the engine for events. If there are events that have completed,
* the engine should at this point hand them off to their dispatcher.
* Engines that operate asynchronously - i.e. the DiskThreads engine -
* should hand events off to their dispatcher as they arrive rather than
* waiting for checkEvents to be called. Engines like poll and select should
* use this call as the time to perform their checks with the OS for new
* events.
*
* The return value is the status code of the event checking. If its a
* The return value is the status code of the event checking. If it is a
* non-negative value then it is used as hint for the minimum requested
* time before checkEvents is called again. I.e. the event engine knows
* how long it is until the next event will be scheduled - so it will
* return that time (in milliseconds).
*
* The timeout value is a requested timeout for this engine - the engine
* should not block for more than this period. (If it takes longer than the
* timeout to do actual checks that's fine though undesirable).
* timeout to do actual checks that is fine, though undesirable).
*/
virtual int checkEvents(int timeout) = 0;
};

#endif /* SQUID_SRC_ASYNCENGINE_H */

#endif /* SQUID_SRC_ENGINES_ASYNCENGINE_H */
Loading
Loading