[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squid-cvs
Subject:    /bzr/squid3/trunk/ r12690: SourceLayout: shuffle fd_table definition into fde.h
From:       Amos Jeffries <squid3 () treenet ! co ! nz>
Date:       2013-02-17 1:55:00
Message-ID: 20130217020005.19324.qmail () squid-cache ! org
[Download RAW message or body]

--===============1562888805==
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------
revno: 12690
committer: Amos Jeffries <squid3@treenet.co.nz>
branch nick: trunk
timestamp: Sun 2013-02-17 14:55:00 +1300
message:
  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.
  
  Also, move it into the fde class scope as a static Table member.
  Provides wrapper definition of fd_table to reduce patch impact.
modified:
  src/fde.cc
  src/fde.h
  src/globals.h

--===============1562888805==
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"; name="r12690.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

=== modified file 'src/fde.cc'
--- a/src/fde.cc	2012-10-08 05:21:11 +0000
+++ b/src/fde.cc	2013-02-17 01:55:00 +0000
@@ -38,6 +38,8 @@
 #include "SquidTime.h"
 #include "Store.h"
 
+fde *fd_table = NULL;
+
 bool
 fde::readPending(int fdNumber)
 {

=== modified file 'src/fde.h'
--- a/src/fde.h	2013-01-30 15:39:37 +0000
+++ b/src/fde.h	2013-02-17 01:55:00 +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'
--- a/src/globals.h	2012-10-08 05:21:11 +0000
+++ b/src/globals.h	2013-02-17 01:55:00 +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 */


--===============1562888805==--
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic