From: Amos Jeffries Date: Fri, 1 Jan 2010 21:26:45 +0000 (+1300) Subject: Merge from trunk X-Git-Tag: SQUID_3_2_0_1~468^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=056b24a17cf83e9b583f318fa7da608d089c795f;p=thirdparty%2Fsquid.git Merge from trunk --- 056b24a17cf83e9b583f318fa7da608d089c795f diff --cc src/Makefile.am index a137123953,e5130672f5..db710015a1 --- a/src/Makefile.am +++ b/src/Makefile.am @@@ -34,7 -34,7 +34,7 @@@ LOADABLE_MODULES_SOURCES = 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 @@@ -534,16 -532,17 +532,18 @@@ nodist_squid_SOURCES = 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) \ @@@ -1197,26 -1220,25 +1221,27 @@@ tests_testCacheManager_SOURCES = 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) \ @@@ -1375,22 -1402,22 +1405,23 @@@ nodist_tests_testEvent_SOURCES = tests_testEvent_LDADD = \ $(COMMON_LIBS) \ icmp/libicmp.la icmp/libicmp-core.la \ + comm/libcomm-listener.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_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 = \ @@@ -1525,22 -1554,22 +1558,23 @@@ nodist_tests_testEventLoop_SOURCES = tests_testEventLoop_LDADD = \ $(COMMON_LIBS) \ icmp/libicmp.la icmp/libicmp-core.la \ + comm/libcomm-listener.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_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 \ @@@ -1670,21 -1701,21 +1706,22 @@@ nodist_tests_test_http_range_SOURCES = tests_test_http_range_LDADD = \ $(COMMON_LIBS) \ icmp/libicmp.la icmp/libicmp-core.la \ + comm/libcomm-listener.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_test_http_range_LDFLAGS = $(LIBADD_DL) tests_test_http_range_DEPENDENCIES = \ - @SQUID_CPPUNIT_LA@ + $(SQUID_CPPUNIT_LA) ## Tests of the HttpRequest module. @@@ -1820,22 -1853,22 +1859,23 @@@ nodist_tests_testHttpRequest_SOURCES = tests_testHttpRequest_LDADD = \ $(COMMON_LIBS) \ icmp/libicmp.la icmp/libicmp-core.la \ + comm/libcomm-listener.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_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 @@@ -1894,10 -1927,11 +1934,12 @@@ tests_testStore_SOURCES= 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) \ @@@ -2171,22 -2220,22 +2228,23 @@@ nodist_tests_testURL_SOURCES = tests_testURL_LDADD = \ $(COMMON_LIBS) \ icmp/libicmp.la icmp/libicmp-core.la \ + comm/libcomm-listener.la \ - @REGEXLIB@ \ - @REPL_OBJS@ \ + 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 diff --cc src/client_side.cc index 98bd6c65b7,596b055368..3c4fda6804 --- a/src/client_side.cc +++ b/src/client_side.cc @@@ -82,30 -82,30 +82,32 @@@ */ #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 diff --cc src/comm.cc index 3492488354,6d6da26ac6..1e8ca109ad --- a/src/comm.cc +++ b/src/comm.cc @@@ -245,15 -242,44 +245,15 @@@ static PF commConnectFree 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; diff --cc src/ftp.cc index 54a8520bae,ef075b0241..45dca5ab8f --- a/src/ftp.cc +++ b/src/ftp.cc @@@ -33,24 -33,15 +33,26 @@@ */ #include "squid.h" -#include "Store.h" -#include "HttpRequest.h" -#include "HttpReply.h" +#include "comm.h" +#include "comm/ListenStateData.h" +#include "ConnectionDetail.h" #include "errorpage.h" #include "fde.h" -#include "comm.h" -#include "HttpHeaderRange.h" +#include "forward.h" #include "HttpHdrContRange.h" +#include "HttpHeaderRange.h" #include "HttpHeader.h" +#include "HttpRequest.h" +#include "HttpReply.h" +#include "MemBuf.h" ++#include "rfc1738.h" +#include "Server.h" ++#include "SquidString.h" +#include "SquidTime.h" +#include "Store.h" +#include "URLScheme.h" +#include "wordlist.h" + #if DELAY_POOLS #include "DelayPools.h" #include "MemObject.h"