------------------------------------------------------------ revno: 12502 revision-id: squid3@treenet.co.nz-20130226222122-lxso4crt1pghd7c9 parent: squid3@treenet.co.nz-20130225034725-0m3h1qkxwtww2smw fixes bug(s): http://bugs.squid-cache.org/show_bug.cgi?id=3720 committer: Amos Jeffries branch nick: 3.3 timestamp: Tue 2013-02-26 15:21:22 -0700 message: Bug 3720: SourceLayout: shuffle fd_table definition into fde.h Shift the definition out of globals.h into fde.h where the type class is defined, and the instance into fde.cc. Fixing bug 3720; build errors on OpenIndiana and Solaris. Also, move it into the fde class scope as a static Table member. Provides wrapper definition of fd_table to reduce patch impact. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20130226222122-lxso4crt1pghd7c9 # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.3 # testament_sha1: 2a2efabd92d047aef23382e979002ab4963e8a4c # timestamp: 2013-02-26 22:57:15 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.3 # base_revision_id: squid3@treenet.co.nz-20130225034725-\ # 0m3h1qkxwtww2smw # # Begin patch === modified file 'src/Makefile.am' --- src/Makefile.am 2012-10-16 23:41:32 +0000 +++ src/Makefile.am 2013-02-26 22:21:22 +0000 @@ -1628,6 +1628,8 @@ tests/stub_fatal.cc \ fd.h \ fd.cc \ + fde.h \ + fde.cc \ FileMap.h \ filemap.cc \ HttpBody.h \ @@ -2868,6 +2870,7 @@ tests/stub_DiskIOModule.cc \ tests/stub_errorpage.cc \ fd.h \ + fde.h \ tests/stub_fd.cc \ tests/stub_helper.cc \ tests/stub_HelperChildConfig.cc \ @@ -3026,6 +3029,8 @@ tests/stub_fatal.cc \ fd.h \ fd.cc \ + fde.h \ + fde.cc \ client_db.h \ disk.h \ disk.cc \ @@ -3189,6 +3194,8 @@ tests/stub_fatal.cc \ fd.h \ fd.cc \ + fde.h \ + fde.cc \ FileMap.h \ filemap.cc \ HttpHeaderFieldStat.h \ @@ -3349,6 +3356,8 @@ tests/stub_fatal.cc \ fd.h \ fd.cc \ + fde.h \ + fde.cc \ disk.h \ disk.cc \ FileMap.h \ === modified file 'src/fde.cc' --- src/fde.cc 2012-09-01 14:38:36 +0000 +++ src/fde.cc 2013-02-26 22:21:22 +0000 @@ -38,6 +38,8 @@ #include "SquidTime.h" #include "Store.h" +fde *fde::Table = NULL; + bool fde::readPending(int fdNumber) { === modified file 'src/fde.h' --- src/fde.h 2012-10-05 07:26:35 +0000 +++ src/fde.h 2013-02-26 22:21:22 +0000 @@ -73,6 +73,10 @@ void noteUse(PconnPool *); public: + + /// global table of FD and their state. + static fde* Table; + unsigned int type; unsigned short remote_port; @@ -193,6 +197,8 @@ } }; +#define fd_table fde::Table + int fdNFree(void); #define FD_READ_METHOD(fd, buf, len) (*fd_table[fd].read_method)(fd, buf, len) === modified file 'src/globals.h' --- src/globals.h 2012-09-17 15:12:01 +0000 +++ src/globals.h 2013-02-26 22:21:22 +0000 @@ -60,8 +60,6 @@ extern const char *pingStatusStr[]; extern const char *storeStatusStr[]; extern const char *swapStatusStr[]; -class fde; -extern fde *fd_table; /* NULL */ extern int Biggest_FD; /* -1 */ extern int Number_FD; /* 0 */ extern int Opening_FD; /* 0 */ === modified file 'src/tests/stub_fd.cc' --- src/tests/stub_fd.cc 2012-08-31 16:57:39 +0000 +++ src/tests/stub_fd.cc 2013-02-26 22:21:22 +0000 @@ -4,6 +4,8 @@ #define STUB_API "fd.cc" #include "tests/STUB.h" +fde *fde::Table = NULL; + int fdNFree(void) STUB_RETVAL(-1) void fd_open(int fd, unsigned int type, const char *desc) STUB void fd_close(int fd) STUB