LoadableModules.h \
LoadableModules.cc
- SUBDIRS = base comm eui acl fs repl auth ip icmp ident
-SUBDIRS = base eui acl fs repl auth ip icmp ident log
++SUBDIRS = base comm eui acl fs repl auth ip icmp ident log
if USE_ADAPTATION
SUBDIRS += adaptation
squid_LDADD = \
$(COMMON_LIBS) \
+ comm/libcomm-listener.la \
+ eui/libeui.la \
icmp/libicmp.la icmp/libicmp-core.la \
- @XTRA_OBJS@ \
- @DISK_LINKOBJS@ \
- @REPL_OBJS@ \
- @DISK_LIBS@ \
- @AIOLIB@ \
- @CRYPTLIB@ \
- @REGEXLIB@ \
- @SNMPLIB@ \
+ log/liblog.la \
+ $(XTRA_OBJS) \
+ $(DISK_LINKOBJS) \
+ $(REPL_OBJS) \
+ $(DISK_LIBS) \
+ $(DISK_OS_LIBS) \
+ $(CRYPTLIB) \
+ $(REGEXLIB) \
+ $(SNMPLIB) \
${ADAPTATION_LIBS} \
$(ESI_LIBS) \
$(COMPAT_LIB) \
wordlist.cc
nodist_tests_testCacheManager_SOURCES = \
$(BUILT_SOURCES)
+# comm.cc only requires comm/libcomm-listener.la until fdc_table is dead.
tests_testCacheManager_LDADD = \
$(COMMON_LIBS) \
+ comm/libcomm-listener.la \
icmp/libicmp.la icmp/libicmp-core.la \
- @REPL_OBJS@ \
+ log/liblog.la \
+ $(REPL_OBJS) \
${ADAPTATION_LIBS} \
$(ESI_LIBS) \
- @REGEXLIB@ \
- @SNMPLIB@ \
+ $(REGEXLIB) \
+ $(SNMPLIB) \
-L../lib -lmiscutil \
- @SQUID_CPPUNIT_LIBS@ \
- @SQUID_CPPUNIT_LA@ \
- @SSLLIB@ \
- @XTRA_LIBS@ \
- @KRB5LIBS@
+ $(SQUID_CPPUNIT_LIBS) \
+ $(SQUID_CPPUNIT_LA) \
+ $(SSLLIB) \
+ $(KRB5LIBS) \
+ $(XTRA_LIBS)
tests_testCacheManager_LDFLAGS = $(LIBADD_DL)
tests_testCacheManager_DEPENDENCIES = $(top_builddir)/lib/libmiscutil.a \
- @REPL_OBJS@ \
- @SQUID_CPPUNIT_LA@
+ $(REPL_OBJS) \
+ $(SQUID_CPPUNIT_LA)
tests_testDiskIO_SOURCES = \
$(SWAP_TEST_SOURCES) \
tests_testEvent_LDADD = \
$(COMMON_LIBS) \
icmp/libicmp.la icmp/libicmp-core.la \
- @REPL_OBJS@ \
+ comm/libcomm-listener.la \
+ log/liblog.la \
+ $(REPL_OBJS) \
${ADAPTATION_LIBS} \
$(ESI_LIBS) \
- @REGEXLIB@ \
- @SNMPLIB@ \
+ $(REGEXLIB) \
+ $(SNMPLIB) \
-L../lib -lmiscutil \
- @SQUID_CPPUNIT_LIBS@ \
- @SQUID_CPPUNIT_LA@ \
- @SSLLIB@ \
- @XTRA_LIBS@ \
- @KRB5LIBS@
+ $(SQUID_CPPUNIT_LIBS) \
+ $(SQUID_CPPUNIT_LA) \
+ $(SSLLIB) \
+ $(KRB5LIBS) \
+ $(XTRA_LIBS)
tests_testEvent_LDFLAGS = $(LIBADD_DL)
tests_testEvent_DEPENDENCIES = $(top_builddir)/lib/libmiscutil.a \
- @REPL_OBJS@ \
- @SQUID_CPPUNIT_LA@
+ $(REPL_OBJS) \
+ $(SQUID_CPPUNIT_LA)
## Tests of the EventLoop module.
tests_testEventLoop_SOURCES = \
tests_testEventLoop_LDADD = \
$(COMMON_LIBS) \
icmp/libicmp.la icmp/libicmp-core.la \
- @REPL_OBJS@ \
+ comm/libcomm-listener.la \
+ log/liblog.la \
+ $(REPL_OBJS) \
${ADAPTATION_LIBS} \
$(ESI_LIBS) \
- @REGEXLIB@ \
- @SNMPLIB@ \
+ $(REGEXLIB) \
+ $(SNMPLIB) \
-L../lib -lmiscutil \
- @SQUID_CPPUNIT_LIBS@ \
- @SQUID_CPPUNIT_LA@ \
- @SSLLIB@ \
- @XTRA_LIBS@ \
- @KRB5LIBS@
+ $(SQUID_CPPUNIT_LIBS) \
+ $(SQUID_CPPUNIT_LA) \
+ $(SSLLIB) \
+ $(KRB5LIBS) \
+ $(XTRA_LIBS)
tests_testEventLoop_LDFLAGS = $(LIBADD_DL)
tests_testEventLoop_DEPENDENCIES = $(top_builddir)/lib/libmiscutil.a \
- @REPL_OBJS@ \
- @SQUID_CPPUNIT_LA@
+ $(REPL_OBJS) \
+ $(SQUID_CPPUNIT_LA)
tests_test_http_range_SOURCES = \
tests/test_http_range.cc \
tests_test_http_range_LDADD = \
$(COMMON_LIBS) \
icmp/libicmp.la icmp/libicmp-core.la \
- @REPL_OBJS@ \
+ comm/libcomm-listener.la \
+ log/liblog.la \
+ $(REPL_OBJS) \
${ADAPTATION_LIBS} \
$(ESI_LIBS) \
- @REGEXLIB@ \
- @SNMPLIB@ \
+ $(REGEXLIB) \
+ $(SNMPLIB) \
-L../lib -lmiscutil \
- @SQUID_CPPUNIT_LIBS@ \
- @SQUID_CPPUNIT_LA@ \
- @SSLLIB@ \
- @XTRA_LIBS@ \
- @KRB5LIBS@
+ $(SQUID_CPPUNIT_LIBS) \
+ $(SQUID_CPPUNIT_LA) \
+ $(SSLLIB) \
+ $(KRB5LIBS) \
+ $(XTRA_LIBS)
tests_test_http_range_LDFLAGS = $(LIBADD_DL)
tests_test_http_range_DEPENDENCIES = \
- @SQUID_CPPUNIT_LA@
+ $(SQUID_CPPUNIT_LA)
## Tests of the HttpRequest module.
tests_testHttpRequest_LDADD = \
$(COMMON_LIBS) \
icmp/libicmp.la icmp/libicmp-core.la \
- @REPL_OBJS@ \
+ comm/libcomm-listener.la \
+ log/liblog.la \
+ $(REPL_OBJS) \
${ADAPTATION_LIBS} \
$(ESI_LIBS) \
- @REGEXLIB@ \
- @SNMPLIB@ \
+ $(REGEXLIB) \
+ $(SNMPLIB) \
-L../lib -lmiscutil \
- @SQUID_CPPUNIT_LIBS@ \
- @SQUID_CPPUNIT_LA@ \
- @SSLLIB@ \
- @XTRA_LIBS@ \
- @KRB5LIBS@
+ $(SQUID_CPPUNIT_LIBS) \
+ $(SQUID_CPPUNIT_LA) \
+ $(SSLLIB) \
+ $(KRB5LIBS) \
+ $(XTRA_LIBS)
tests_testHttpRequest_LDFLAGS = $(LIBADD_DL)
tests_testHttpRequest_DEPENDENCIES = $(top_builddir)/lib/libmiscutil.a \
- @REPL_OBJS@ \
- @SQUID_CPPUNIT_LA@
+ $(REPL_OBJS) \
+ $(SQUID_CPPUNIT_LA)
# TODO:mime.cc drags in HttpReply.cc
# delay pools need client_side_request.cc
tests/testStoreHashIndex.h \
tests/TestSwapDir.cc \
tests/TestSwapDir.h \
+ tests/stub_fd.cc \
+ tests/stub_HelperChildConfig.cc \
tests/stub_HttpReply.cc \
tests/stub_cache_manager.cc \
- $(STORE_TEST_SOURCES)
+ $(STORE_TEST_SOURCES) \
+ tests/stub_fd.cc
nodist_tests_testStore_SOURCES= \
$(TESTSOURCES) \
tests_testURL_LDADD = \
$(COMMON_LIBS) \
icmp/libicmp.la icmp/libicmp-core.la \
- @REGEXLIB@ \
- @REPL_OBJS@ \
+ comm/libcomm-listener.la \
+ log/liblog.la \
+ $(REGEXLIB) \
+ $(REPL_OBJS) \
${ADAPTATION_LIBS} \
$(ESI_LIBS) \
- @SNMPLIB@ \
+ $(SNMPLIB) \
-L../lib -lmiscutil \
- @SQUID_CPPUNIT_LIBS@ \
- @SQUID_CPPUNIT_LA@ \
- @SSLLIB@ \
- @XTRA_LIBS@ \
- @KRB5LIBS@
+ $(SQUID_CPPUNIT_LIBS) \
+ $(SQUID_CPPUNIT_LA) \
+ $(SSLLIB) \
+ $(KRB5LIBS) \
+ $(XTRA_LIBS)
tests_testURL_LDFLAGS = $(LIBADD_DL)
tests_testURL_DEPENDENCIES = $(top_builddir)/lib/libmiscutil.a \
- @REPL_OBJS@ \
- @SQUID_CPPUNIT_LA@
+ $(REPL_OBJS) \
+ $(SQUID_CPPUNIT_LA)
TESTS += testHeaders
*/
#include "squid.h"
+
+#include "acl/FilledChecklist.h"
+#include "auth/UserRequest.h"
+#include "ChunkedCodingParser.h"
#include "client_side.h"
+#include "client_side_reply.h"
+#include "client_side_request.h"
+#include "ClientRequestContext.h"
#include "clientStream.h"
-#include "ProtoPort.h"
-#include "auth/UserRequest.h"
-#include "Store.h"
#include "comm.h"
+#include "comm/ListenStateData.h"
+#include "ConnectionDetail.h"
++#include "eui/Config.h"
+#include "fde.h"
#include "HttpHdrContRange.h"
#include "HttpReply.h"
#include "HttpRequest.h"
#include "ident/Config.h"
#include "ident/Ident.h"
#include "ip/IpIntercept.h"
-#include "MemObject.h"
-#include "fde.h"
-#include "client_side_request.h"
-#include "acl/FilledChecklist.h"
-#include "ConnectionDetail.h"
-#include "client_side_reply.h"
-#include "ClientRequestContext.h"
#include "MemBuf.h"
-#include "SquidTime.h"
-#include "ChunkedCodingParser.h"
-#include "eui/Config.h"
+#include "MemObject.h"
+#include "ProtoPort.h"
+ #include "rfc1738.h"
+#include "SquidTime.h"
+#include "Store.h"
#if LINGERING_CLOSE
#define comm_close comm_lingering_close
static PF commHandleWrite;
static IPH commConnectDnsHandle;
-static PF comm_accept_try;
-
-class AcceptFD
-{
-
-public:
- AcceptFD(int aFd = -1): fd(aFd), theCallback(0), mayAcceptMore(false) {}
-
- void subscribe(AsyncCall::Pointer &call);
- void acceptNext();
- void notify(int newfd, comm_err_t, int xerrno, const ConnectionDetail &);
-
- int fd;
-
-private:
- bool acceptOne();
-
- AsyncCall::Pointer theCallback;
- bool mayAcceptMore;
-};
-
typedef enum {
COMM_CB_READ = 1,
- COMM_CB_DERIVED,
+ COMM_CB_DERIVED
} comm_callback_t;
-struct _fd_debug_t {
- char const *close_file;
- int close_line;
-};
-
-typedef struct _fd_debug_t fd_debug_t;
-
static MemAllocator *conn_close_pool = NULL;
-AcceptFD *fdc_table = NULL; // TODO: rename. And use Vector<>?
fd_debug_t *fdd_table = NULL;
-static bool
+bool
isOpen(const int fd)
{
return fd_table[fd].flags.open != 0;