trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject svn commit: r982071 - in /trafficserver/traffic/trunk: iocore/cache/ iocore/cluster/ iocore/dns/ iocore/hostdb/ iocore/utils/ proxy/ proxy/http2/
Date Tue, 03 Aug 2010 23:21:57 GMT
Author: zwoop
Date: Tue Aug  3 23:21:56 2010
New Revision: 982071

URL: http://svn.apache.org/viewvc?rev=982071&view=rev
Log:
TS-400 Checkpoint 5 in cleanup.

This passes diagnostics and basic test.

Modified:
    trafficserver/traffic/trunk/iocore/cache/NewCacheVC.h
    trafficserver/traffic/trunk/iocore/cache/P_CacheDir.h
    trafficserver/traffic/trunk/iocore/cache/P_CacheHosting.h
    trafficserver/traffic/trunk/iocore/cache/P_CacheInternal.h
    trafficserver/traffic/trunk/iocore/cluster/P_ClusterCache.h
    trafficserver/traffic/trunk/iocore/cluster/P_ClusterHandler.h
    trafficserver/traffic/trunk/iocore/cluster/P_ClusterInternal.h
    trafficserver/traffic/trunk/iocore/cluster/P_ClusterMachine.h
    trafficserver/traffic/trunk/iocore/dns/DNSConnection.cc
    trafficserver/traffic/trunk/iocore/dns/P_SplitDNSProcessor.h
    trafficserver/traffic/trunk/iocore/dns/SplitDNS.cc
    trafficserver/traffic/trunk/iocore/hostdb/HostDB.cc
    trafficserver/traffic/trunk/iocore/hostdb/P_HostDBProcessor.h
    trafficserver/traffic/trunk/iocore/hostdb/P_MultiCache.h
    trafficserver/traffic/trunk/iocore/utils/I_OneWayTunnel.h
    trafficserver/traffic/trunk/proxy/Show.h
    trafficserver/traffic/trunk/proxy/http2/HttpTransactCache.h

Modified: trafficserver/traffic/trunk/iocore/cache/NewCacheVC.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/NewCacheVC.h?rev=982071&r1=982070&r2=982071&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/NewCacheVC.h (original)
+++ trafficserver/traffic/trunk/iocore/cache/NewCacheVC.h Tue Aug  3 23:21:56 2010
@@ -93,11 +93,13 @@ public:
   }
   bool set_pin_in_cache(time_t time_pin)
   {
+    NOWARN_UNUSED(time_pin);
     ink_assert(!"implemented");
     return false;
   }
   bool set_disk_io_priority(int priority)
   {
+    NOWARN_UNUSED(priority);
     ink_assert(!"implemented");
     return false;
   }
@@ -114,16 +116,22 @@ public:
   }
   int get_header(void **ptr, int *len)
   {
+    NOWARN_UNUSED(ptr);
+    NOWARN_UNUSED(len);
     ink_assert(!"implemented");
     return -1;
   }
   int set_header(void *ptr, int len)
   {
+    NOWARN_UNUSED(ptr);
+    NOWARN_UNUSED(len);
     ink_assert(!"implemented");
     return -1;
   }
   int get_single_data(void **ptr, int *len)
   {
+    NOWARN_UNUSED(ptr);
+    NOWARN_UNUSED(len);
     ink_assert(!"implemented");
     return -1;
   }
@@ -133,6 +141,10 @@ public:
     return -1;
   }
   VIO *do_io_pread(Continuation *c, int64 nbytes, MIOBuffer *buf, int64 offset) {
+    NOWARN_UNUSED(c);
+    NOWARN_UNUSED(nbytes);
+    NOWARN_UNUSED(buf);
+    NOWARN_UNUSED(offset);
     ink_assert(!"implemented");
     return 0;
   }

Modified: trafficserver/traffic/trunk/iocore/cache/P_CacheDir.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/P_CacheDir.h?rev=982071&r1=982070&r2=982071&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/P_CacheDir.h (original)
+++ trafficserver/traffic/trunk/iocore/cache/P_CacheDir.h Tue Aug  3 23:21:56 2010
@@ -192,7 +192,7 @@ struct FreeDir
 // alternates from this vector is done under the Part::lock. The alternate
 // is deleted/inserted into the vector just before writing the vector disk
 // (CacheVC::updateVector).
-LINK_FORWARD_DECLARATION(CacheVC, opendir_link); // forward declaration
+LINK_FORWARD_DECLARATION(CacheVC, opendir_link) // forward declaration
 struct OpenDirEntry
 {
   DLL<CacheVC, Link_CacheVC_opendir_link> writers;       // list of all the current
writers
@@ -221,7 +221,7 @@ struct OpenDirEntry
   }
 };
 
-struct OpenDir:Continuation
+struct OpenDir: public Continuation
 {
   Queue<CacheVC, Link_CacheVC_opendir_link> delayed_readers;
   DLL<OpenDirEntry> bucket[OPEN_DIR_BUCKETS];
@@ -234,7 +234,7 @@ struct OpenDir:Continuation
   OpenDir();
 };
 
-struct CacheSync:Continuation
+struct CacheSync: public Continuation
 {
   int part;
   char *buf;

Modified: trafficserver/traffic/trunk/iocore/cache/P_CacheHosting.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/P_CacheHosting.h?rev=982071&r1=982070&r2=982071&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/P_CacheHosting.h (original)
+++ trafficserver/traffic/trunk/iocore/cache/P_CacheHosting.h Tue Aug  3 23:21:56 2010
@@ -153,7 +153,7 @@ private:
 
 struct CacheHostTableConfig;
 typedef int (CacheHostTableConfig::*CacheHostTabHandler) (int, void *);
-struct CacheHostTableConfig:Continuation
+struct CacheHostTableConfig: public Continuation
 {
   CacheHostTable **ppt;
     CacheHostTableConfig(CacheHostTable ** appt)

Modified: trafficserver/traffic/trunk/iocore/cache/P_CacheInternal.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/P_CacheInternal.h?rev=982071&r1=982070&r2=982071&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/P_CacheInternal.h (original)
+++ trafficserver/traffic/trunk/iocore/cache/P_CacheInternal.h Tue Aug  3 23:21:56 2010
@@ -226,7 +226,7 @@ extern int cache_config_hit_evacuate_siz
 #endif
 
 // CacheVC
-struct CacheVC:CacheVConnection
+struct CacheVC: public CacheVConnection
 {
   CacheVC();
 
@@ -492,7 +492,7 @@ struct CacheVC:CacheVConnection
     ink_assert(handler != (ContinuationHandler)(&CacheVC::dead)); \
   } while (0)
 
-struct CacheRemoveCont:Continuation
+struct CacheRemoveCont: public Continuation
 {
   int event_handler(int event, void *data);
 
@@ -1011,6 +1011,7 @@ Cache::open_read(Continuation *cont, Cac
 TS_INLINE void
 Cache::generate_key(INK_MD5 *md5, URL *url, CacheHTTPHdr *request)
 {
+  NOWARN_UNUSED(request);
 #ifdef BROKEN_HACK_FOR_VARY_ON_UA
   // We probably should make this configurable, both enabling it and what
   // MIME types we want to treat differently. // Leif
@@ -1156,6 +1157,7 @@ CacheProcessor::open_write_buffer(Contin
                                   CacheFragType frag_type, int options, time_t pin_in_cache,
                                   char *hostname, int host_len)
 {
+  NOWARN_UNUSED(pin_in_cache);
   (void)cont;
   (void)buf;
   (void)key;
@@ -1320,6 +1322,6 @@ local_cache()
   return theCache;
 }
 
-LINK_DEFINITION(CacheVC, opendir_link);
+LINK_DEFINITION(CacheVC, opendir_link)
 
 #endif /* _P_CACHE_INTERNAL_H__ */

Modified: trafficserver/traffic/trunk/iocore/cluster/P_ClusterCache.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/P_ClusterCache.h?rev=982071&r1=982070&r2=982071&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/P_ClusterCache.h (original)
+++ trafficserver/traffic/trunk/iocore/cluster/P_ClusterCache.h Tue Aug  3 23:21:56 2010
@@ -339,7 +339,7 @@ struct ClusterVConnState
   ClusterVConnState();
 };
 
-struct ClusterVConnectionBase:CacheVConnection
+struct ClusterVConnectionBase: public CacheVConnection
 {
   //
   // Initiate an IO operation.
@@ -385,8 +385,8 @@ struct ClusterVConnectionBase:CacheVConn
   volatile int closed;
   ClusterVConnState read;
   ClusterVConnState write;
-  LINKM(ClusterVConnectionBase, read, link);
-  LINKM(ClusterVConnectionBase, write, link);
+  LINKM(ClusterVConnectionBase, read, link)
+  LINKM(ClusterVConnectionBase, write, link)
   ink_hrtime inactivity_timeout_in;
   ink_hrtime active_timeout_in;
   Event *inactivity_timeout;
@@ -483,7 +483,7 @@ private:
 //
 // ClusterVConnection
 //
-struct ClusterVConnection:ClusterVConnectionBase
+struct ClusterVConnection: public ClusterVConnectionBase
 {
   //
   // Public Interface (included from ClusterVConnectionBase)

Modified: trafficserver/traffic/trunk/iocore/cluster/P_ClusterHandler.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/P_ClusterHandler.h?rev=982071&r1=982070&r2=982071&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/P_ClusterHandler.h (original)
+++ trafficserver/traffic/trunk/iocore/cluster/P_ClusterHandler.h Tue Aug  3 23:21:56 2010
@@ -45,7 +45,7 @@ struct ClusterCalloutContinuation:public
    ~ClusterCalloutContinuation();
 };
 
-struct ClusterControl:Continuation
+struct ClusterControl: public Continuation
 {
   int len;
   char size_index;
@@ -81,7 +81,7 @@ struct ClusterControl:Continuation
   virtual void freeall() = 0;
 };
 
-struct OutgoingControl:ClusterControl
+struct OutgoingControl: public ClusterControl
 {
   ClusterMachine *m;
   ink_hrtime submit_time;
@@ -124,7 +124,7 @@ struct OutgoingControl:ClusterControl
 //
 // incoming control messsage are received by this machine
 //
-struct IncomingControl:ClusterControl
+struct IncomingControl: public ClusterControl
 {
   ink_hrtime recognized_time;
 
@@ -402,7 +402,7 @@ struct ClusterState:Continuation
 // ClusterHandlerBase superclass for processors with
 // bi-directional VConnections.
 //
-struct ClusterHandlerBase:Continuation
+struct ClusterHandlerBase: public Continuation
 {
   //
   // Private

Modified: trafficserver/traffic/trunk/iocore/cluster/P_ClusterInternal.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/P_ClusterInternal.h?rev=982071&r1=982070&r2=982071&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/P_ClusterInternal.h (original)
+++ trafficserver/traffic/trunk/iocore/cluster/P_ClusterInternal.h Tue Aug  3 23:21:56 2010
@@ -140,14 +140,14 @@
 /*************************************************************************/
 // Testing Defines
 /*************************************************************************/
-// #define MISS_TEST                1
-// #define TEST_PARTIAL_WRITES      1
-// #define TEST_PARTIAL_READS       1
-// #define TEST_TIMING              1
-// #define TEST_READ_LOCKS_MISSED   1
-// #define TEST_WRITE_LOCKS_MISSED  1
-// #define TEST_ENTER_EXIT          1
-// #define TEST_ENTER_EXIT          1
+#define MISS_TEST                0
+#define TEST_PARTIAL_WRITES      0
+#define TEST_PARTIAL_READS       0
+#define TEST_TIMING              0
+#define TEST_READ_LOCKS_MISSED   0
+#define TEST_WRITE_LOCKS_MISSED  0
+#define TEST_ENTER_EXIT          0
+#define TEST_ENTER_EXIT          0
 
 //
 // Timing testing
@@ -193,7 +193,7 @@ test_cluster_lock_might_fail()
 #define TEST_WRITE_LOCK_MIGHT_FAIL false
 #endif
 
-#ifdef TEST_ENTER_EXIT
+#if TEST_ENTER_EXIT
 struct enter_exit_class
 {
   int *outv;

Modified: trafficserver/traffic/trunk/iocore/cluster/P_ClusterMachine.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/P_ClusterMachine.h?rev=982071&r1=982070&r2=982071&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/P_ClusterMachine.h (original)
+++ trafficserver/traffic/trunk/iocore/cluster/P_ClusterMachine.h Tue Aug  3 23:21:56 2010
@@ -55,7 +55,7 @@
 
 class ClusterHandler;           // Leave this a class - VC++ gets very anal  ~SR
 
-struct ClusterMachine:Server
+struct ClusterMachine: public Server
 {
   bool dead;
   char *hostname;

Modified: trafficserver/traffic/trunk/iocore/dns/DNSConnection.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/dns/DNSConnection.cc?rev=982071&r1=982070&r2=982071&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/dns/DNSConnection.cc (original)
+++ trafficserver/traffic/trunk/iocore/dns/DNSConnection.cc Tue Aug  3 23:21:56 2010
@@ -78,7 +78,6 @@ DNSConnection::connect(unsigned int ip, 
   ink_assert(fd == NO_FD);
 
   int res = 0;
-  ink_hrtime t;
   short Proto;
 
   if (use_tcp) {
@@ -139,7 +138,6 @@ DNSConnection::connect(unsigned int ip, 
     goto Lerror;
 #endif
 
-  t = ink_get_hrtime();
   res =::connect(fd, (struct sockaddr *) &sa, sizeof(struct sockaddr_in));
 
   if (!res || ((res < 0) && (errno == EINPROGRESS || errno == EWOULDBLOCK))) {

Modified: trafficserver/traffic/trunk/iocore/dns/P_SplitDNSProcessor.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/dns/P_SplitDNSProcessor.h?rev=982071&r1=982070&r2=982071&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/dns/P_SplitDNSProcessor.h (original)
+++ trafficserver/traffic/trunk/iocore/dns/P_SplitDNSProcessor.h Tue Aug  3 23:21:56 2010
@@ -42,8 +42,6 @@
 /* ---------------------------
    forward declarations ...
    --------------------------- */
-
-
 void ink_split_dns_init(ModuleVersion version);
 
 #define MAX_CONFIGS  100
@@ -67,21 +65,16 @@ enum DNSResultType
 typedef ControlMatcher<SplitDNSRecord, SplitDNSResult> DNS_table;
 
 
-
-
 /* --------------------------------------------------------------
    **                struct SplitDNSResult
    -------------------------------------------------------------- */
-
 struct SplitDNSResult
 {
-
   SplitDNSResult();
 
   /* ------------
      public
      ------------ */
-
   DNSResultType r;
 
   DNSServer *get_dns_record();
@@ -97,15 +90,12 @@ struct SplitDNSResult
 };
 
 
-/* --------------------------------------------------------------
-   -------------------------------------------------------------- */
 struct SplitDNSConfigInfo
 {
   volatile int m_refcount;
 
-    virtual ~ SplitDNSConfigInfo()
-  {
-  }
+  virtual ~SplitDNSConfigInfo()
+  { }
 };
 
 
@@ -129,13 +119,11 @@ extern SplitDNSConfigProcessor SplitDNSc
 /* --------------------------------------------------------------
    **                struct SplitDNS
    -------------------------------------------------------------- */
-
 struct SplitDNS:public SplitDNSConfigInfo
 {
   SplitDNS();
   ~SplitDNS();
 
-
   void *getDNSRecord(char *hostname);
   void findServer(RD * rdata, SplitDNSResult * result);
 
@@ -156,9 +144,6 @@ struct SplitDNS:public SplitDNSConfigInf
   void *m_pxLeafArray;
   int m_numEle;
 };
-/* --------------------------------------------------------------
-   -------------------------------------------------------------- */
-
 
 
 /* --------------------------------------------------------------
@@ -170,41 +155,29 @@ TS_INLINE bool SplitDNSConfig::isSplitDN
 }
 
 
-/* --------------------------------------------------------------
-   -------------------------------------------------------------- */
-
 //
 // End API to outside world
 //
 
 
-
 /* --------------------------------------------------------------
    **                struct DNSServer
 
    A record for an single server
    -------------------------------------------------------------- */
-
-
 struct DNSServer
 {
-  unsigned long
-    x_server_ip[MAXNS];
-  char
-    x_dns_ip_line[MAXDNAME * 2];
-
-  char
-    x_def_domain[MAXDNAME];
-  char
-    x_domain_srch_list[MAXDNAME];
-  int
-    x_dns_server_port[MAXNS];
+  unsigned long x_server_ip[MAXNS];
+  char x_dns_ip_line[MAXDNAME * 2];
+
+  char x_def_domain[MAXDNAME];
+  char x_domain_srch_list[MAXDNAME];
+  int  x_dns_server_port[MAXNS];
 
-  DNSHandler *
-    x_dnsH;
+  DNSHandler *x_dnsH;
 
-  DNSServer():
-  x_dnsH(NULL)
+  DNSServer()
+  : x_dnsH(NULL)
   {
     memset(x_server_ip, 0, sizeof(x_server_ip));
     memset(x_dns_server_port, 0, sizeof(x_dns_server_port));
@@ -221,32 +194,20 @@ struct DNSServer
 
    A record for an single server
    -------------------------------------------------------------- */
-
-
-class
-  DNSRequestData:
-  public
-  RequestData
+class DNSRequestData: public RequestData
 {
 public:
 
   DNSRequestData();
 
-  char *
-  get_string();
+  char *get_string();
 
-  const char *
-  get_host();
+  const char *get_host();
 
-  ip_addr_t
-  get_ip();
+  ip_addr_t get_ip();
+  ip_addr_t get_client_ip();
 
-  ip_addr_t
-  get_client_ip();
-
-
-  const char *
-    m_pHost;
+  const char *m_pHost;
 };
 
 
@@ -254,7 +215,7 @@ public:
    DNSRequestData::get_string()
    -------------------------------------------------------------- */
 TS_INLINE DNSRequestData::DNSRequestData()
-:m_pHost(0)
+: m_pHost(0)
 {
 }
 
@@ -262,7 +223,6 @@ TS_INLINE DNSRequestData::DNSRequestData
 /* --------------------------------------------------------------
    DNSRequestData::get_string()
    -------------------------------------------------------------- */
-
 TS_INLINE char *
 DNSRequestData::get_string()
 {
@@ -273,7 +233,6 @@ DNSRequestData::get_string()
 /* --------------------------------------------------------------
    DNSRequestData::get_host()
    -------------------------------------------------------------- */
-
 TS_INLINE const char *
 DNSRequestData::get_host()
 {
@@ -284,7 +243,6 @@ DNSRequestData::get_host()
 /* --------------------------------------------------------------
    DNSRequestData::get_ip()
    -------------------------------------------------------------- */
-
 TS_INLINE ip_addr_t DNSRequestData::get_ip()
 {
   return (ip_addr_t) 0;
@@ -294,83 +252,51 @@ TS_INLINE ip_addr_t DNSRequestData::get_
 /* --------------------------------------------------------------
    DNSRequestData::get_client_ip()
    -------------------------------------------------------------- */
-
 TS_INLINE ip_addr_t DNSRequestData::get_client_ip()
 {
   return (ip_addr_t) 0;
 }
 
-
-
-/* --------------------------------------------------------------
-   -------------------------------------------------------------- */
-
-
-
 /* --------------------------------------------------------------
    *                 class SplitDNSRecord
 
    A record for a configuration line in the splitdns.config file
    -------------------------------------------------------------- */
-
-class
-  SplitDNSRecord:
-  public
-  ControlBase
+class SplitDNSRecord: public ControlBase
 {
 public:
 
   SplitDNSRecord();
-  ~
-  SplitDNSRecord();
+  ~SplitDNSRecord();
+
+  char *Init(matcher_line * line_info);
 
-  char *
-  Init(matcher_line * line_info);
+  const char *ProcessDNSHosts(char *val);
+  const char *ProcessDomainSrchList(char *val);
+  const char *ProcessDefDomain(char *val);
 
-  const char *
-  ProcessDNSHosts(char *val);
-  const char *
-  ProcessDomainSrchList(char *val);
-  const char *
-  ProcessDefDomain(char *val);
-
-  void
-  UpdateMatch(SplitDNSResult * result, RD * rdata);
-  void
-  Print();
-
-
-  DNSServer
-    m_servers;
-  int
-    m_dnsSrvr_cnt;
-  int
-    m_domain_srch_list;
+  void UpdateMatch(SplitDNSResult * result, RD * rdata);
+  void Print();
+
+  DNSServer m_servers;
+  int m_dnsSrvr_cnt;
+  int m_domain_srch_list;
 };
 
 
 /* --------------------------------------------------------------
    SplitDNSRecord::SplitDNSRecord()
    -------------------------------------------------------------- */
-
 TS_INLINE SplitDNSRecord::SplitDNSRecord()
-:m_dnsSrvr_cnt(0), m_domain_srch_list(0)
-{
-}
+: m_dnsSrvr_cnt(0), m_domain_srch_list(0)
+{ }
 
 
 /* --------------------------------------------------------------
    SplitDNSRecord::~SplitDNSRecord()
    -------------------------------------------------------------- */
-
 TS_INLINE SplitDNSRecord::~SplitDNSRecord()
-{
-}
-
-
-
-/* --------------------------------------------------------------
-   -------------------------------------------------------------- */
+{ }
 
 
 /* --------------------------------------------------------------
@@ -378,13 +304,9 @@ TS_INLINE SplitDNSRecord::~SplitDNSRecor
    Used to handle parent.conf or default parent updates after the
    manager signals a change
    -------------------------------------------------------------- */
-
-struct SDNS_UpdateContinuation:
-  Continuation
+struct SDNS_UpdateContinuation: public Continuation
 {
-
-  int
-  handle_event(int event, void *data);
+  int handle_event(int event, void *data);
   SDNS_UpdateContinuation(ProxyMutex * m);
 
 };
@@ -393,9 +315,8 @@ struct SDNS_UpdateContinuation:
 /* --------------------------------------------------------------
    SDNS_UpdateContinuation::SDNS_UpdateContinuation()
    -------------------------------------------------------------- */
-
 TS_INLINE SDNS_UpdateContinuation::SDNS_UpdateContinuation(ProxyMutex * m)
-:Continuation(m)
+: Continuation(m)
 {
   SET_HANDLER(&SDNS_UpdateContinuation::handle_event);
 }
@@ -404,7 +325,6 @@ TS_INLINE SDNS_UpdateContinuation::SDNS_
 /* --------------------------------------------------------------
    SDNS_UpdateContinuation::handle_event()
    -------------------------------------------------------------- */
-
 TS_INLINE int
 SDNS_UpdateContinuation::handle_event(int event, void *data)
 {
@@ -417,14 +337,6 @@ SDNS_UpdateContinuation::handle_event(in
   return EVENT_DONE;
 }
 
-
-/* --------------------------------------------------------------
-   -------------------------------------------------------------- */
-
-
-
-
-
 /* ------------------
    Helper Functions
    ------------------ */

Modified: trafficserver/traffic/trunk/iocore/dns/SplitDNS.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/dns/SplitDNS.cc?rev=982071&r1=982070&r2=982071&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/dns/SplitDNS.cc (original)
+++ trafficserver/traffic/trunk/iocore/dns/SplitDNS.cc Tue Aug  3 23:21:56 2010
@@ -32,7 +32,6 @@
 
 #ifdef SPLIT_DNS
 
-
 #include "P_SplitDNS.h"
 
 #include <sys/types.h>
@@ -52,8 +51,6 @@
 
 SplitDNSConfigProcessor SplitDNSconfigProcessor;
 
-typedef struct __res_state ResState;
-
 /* --------------------------------------------------------------
    this file is built using "ParentSelection.cc as a template.
    -------------    ------------------------------------------------- */
@@ -61,7 +58,6 @@ typedef struct __res_state ResState;
 /* --------------------------------------------------------------
    globals
    -------------------------------------------------------------- */
-
 static const char modulePrefix[] = "[SplitDNS]";
 static Ptr<ProxyMutex> reconfig_mutex = NULL;
 
@@ -80,7 +76,6 @@ static const char *sdns_def_domain = "pr
    used by a lot of protocols. We do not have dest ip in most
    cases.
    -------------------------------------------------------------- */
-
 const matcher_tags sdns_dest_tags = {
   "dest_host", "dest_domain", NULL, "url_regex", NULL, true
 };
@@ -89,7 +84,6 @@ const matcher_tags sdns_dest_tags = {
 /* --------------------------------------------------------------
    config Callback Prototypes
    -------------------------------------------------------------- */
-
 enum SplitDNSCB_t
 {
 
@@ -98,7 +92,6 @@ enum SplitDNSCB_t
 };
 
 
-
 static const char *SDNSResultStr[] = {
   "DNSServer_Undefined",
   "DNSServer_Specified",
@@ -107,41 +100,26 @@ static const char *SDNSResultStr[] = {
 };
 
 
-
-int
-  SplitDNSConfig::m_id = 0;
-int
-  SplitDNSConfig::gsplit_dns_enabled = 0;
+int SplitDNSConfig::m_id = 0;
+int SplitDNSConfig::gsplit_dns_enabled = 0;
 Ptr<ProxyMutex> SplitDNSConfig::dnsHandler_mutex = 0;
 
-extern struct __res_state
-  _res;
-
-
 
 /* --------------------------------------------------------------
    SplitDNSResult::SplitDNSResult()
    -------------------------------------------------------------- */
-
 inline SplitDNSResult::SplitDNSResult()
-:r(DNS_SRVR_UNDEFINED), m_line_number(0), m_rec(0), m_wrap_around(false)
+: r(DNS_SRVR_UNDEFINED), m_line_number(0), m_rec(0), m_wrap_around(false)
 {
 }
 
-/* --------------------------------------------------------------
-   -------------------------------------------------------------- */
-
-
 
 /* --------------------------------------------------------------
    SplitDNS::SplitDNS()
    -------------------------------------------------------------- */
-
 SplitDNS::SplitDNS()
-
-:m_DNSSrvrTable(NULL),
-m_DefaultDNSSrvr(NULL),
-m_SplitDNSlEnable(0), m_def_domain_len(0), m_bEnableFastPath(false), m_pxLeafArray(NULL),
m_numEle(0)
+: m_DNSSrvrTable(NULL), m_DefaultDNSSrvr(NULL), m_SplitDNSlEnable(0), m_def_domain_len(0),
+  m_bEnableFastPath(false), m_pxLeafArray(NULL), m_numEle(0)
 {
   memset(m_def_domain, 0, MAXDNAME);
 }
@@ -150,7 +128,6 @@ m_SplitDNSlEnable(0), m_def_domain_len(0
 /* --------------------------------------------------------------
    SplitDNS::SplitDNS()
    -------------------------------------------------------------- */
-
 SplitDNS::~SplitDNS()
 {
 
@@ -178,7 +155,6 @@ SplitDNSConfig::acquire()
 /* --------------------------------------------------------------
    SplitDNSConfig::release()
    -------------------------------------------------------------- */
-
 void
 SplitDNSConfig::release(SplitDNS * params)
 {
@@ -188,21 +164,18 @@ SplitDNSConfig::release(SplitDNS * param
 /* --------------------------------------------------------------
    SplitDNSConfig::startup()
    -------------------------------------------------------------- */
-
 void
 SplitDNSConfig::startup()
 {
   reconfig_mutex = new_ProxyMutex();
   dnsHandler_mutex = new_ProxyMutex();
   reconfigure();
-
 }
 
 
 /* --------------------------------------------------------------
    SplitDNSConfig::reconfigure()
    -------------------------------------------------------------- */
-
 void
 SplitDNSConfig::reconfigure()
 {
@@ -272,7 +245,6 @@ SplitDNSConfig::reconfigure()
 /* --------------------------------------------------------------
    SplitDNSConfig::print()
    -------------------------------------------------------------- */
-
 void
 SplitDNSConfig::print()
 {
@@ -300,17 +272,11 @@ SplitDNSConfig::print()
 
 
 /* --------------------------------------------------------------
-   -------------------------------------------------------------- */
-
-/* --------------------------------------------------------------
    SplitDNS::getDNSRecord()
    -------------------------------------------------------------- */
-
 void *
 SplitDNS::getDNSRecord(char *hostname)
 {
-
-
   char szHostName[MAXDNAME];
   char *pInHost = hostname;
   size_t remaining_str_size = sizeof szHostName;
@@ -341,8 +307,6 @@ SplitDNS::getDNSRecord(char *hostname)
   pRD->m_pHost = 0;
   DNSReqAllocator.free(pRD);
 
-
-
   if (DNS_SRVR_UNDEFINED == res.r) {
 
     Warning("Failed to match a valid DNS server!");
@@ -364,22 +328,18 @@ SplitDNS::getDNSRecord(char *hostname)
 }
 
 
-
 /* --------------------------------------------------------------
    SplitDNS::findServer()
    -------------------------------------------------------------- */
-
 void
 SplitDNS::findServer(RD * rdata, SplitDNSResult * result)
 {
-
   DNS_table *tablePtr = m_DNSSrvrTable;
   SplitDNSRecord *defaultPtr = m_DefaultDNSSrvr;
   SplitDNSRecord *rec;
 
   ink_assert(result->r == DNS_SRVR_UNDEFINED);
 
-
   if (m_SplitDNSlEnable == 0) {
     result->r = DNS_SRVR_UNDEFINED;
     return;
@@ -392,7 +352,6 @@ SplitDNS::findServer(RD * rdata, SplitDN
   /* ---------------------------
      the 'alleged' fast path ...
      --------------------------- */
-
   if (m_bEnableFastPath) {
 
     SplitDNSRecord *data_ptr = 0;
@@ -483,7 +442,6 @@ SplitDNS::findServer(RD * rdata, SplitDN
 /* --------------------------------------------------------------
    SplitDNSRecord::ProcessDNSHosts()
    -------------------------------------------------------------- */
-
 const char *
 SplitDNSRecord::ProcessDNSHosts(char *val)
 {
@@ -494,7 +452,6 @@ SplitDNSRecord::ProcessDNSHosts(char *va
   char *tmp;
   int totsz = 0, sz = 0;
 
-
   numTok = pTok.Initialize(val, SHARE_TOKS);
   if (MAXNS < numTok) {
     numTok = MAXNS;
@@ -510,8 +467,6 @@ SplitDNSRecord::ProcessDNSHosts(char *va
      ------------------------------------------------ */
 
   for (int i = 0; i < numTok; i++) {
-
-
     current = pTok[i];
 
     tmp = (char *) strchr(current, ':');
@@ -569,14 +524,12 @@ SplitDNSRecord::ProcessDNSHosts(char *va
 /* --------------------------------------------------------------
    SplitDNSRecord::ProcessDefDomain()
    -------------------------------------------------------------- */
-
 const char *
 SplitDNSRecord::ProcessDefDomain(char *val)
 {
   Tokenizer pTok(",; \t\r");
   int numTok;
 
-
   numTok = pTok.Initialize(val, SHARE_TOKS);
 
   if (numTok > 1) {
@@ -598,11 +551,9 @@ SplitDNSRecord::ProcessDefDomain(char *v
 }
 
 
-
 /* --------------------------------------------------------------
    SplitDNSRecord::ProcessDomainSrchList()
    -------------------------------------------------------------- */
-
 const char *
 SplitDNSRecord::ProcessDomainSrchList(char *val)
 {
@@ -643,7 +594,6 @@ SplitDNSRecord::ProcessDomainSrchList(ch
    matcher_line* line_info - contains parsed label/value pairs
    of the current split.config line
    -------------------------------------------------------------- */
-
 char *
 SplitDNSRecord::Init(matcher_line * line_info)
 {
@@ -657,7 +607,6 @@ SplitDNSRecord::Init(matcher_line * line
 
   this->line_num = line_info->line_num;
 
-
   for (int i = 0; i < MATCHER_MAX_TOKENS; i++) {
 
     label = line_info->line[0][i];
@@ -722,7 +671,7 @@ SplitDNSRecord::Init(matcher_line * line
                           &m_servers.x_def_domain[0], &m_servers.x_domain_srch_list[0])))
{
 
     snprintf(errBuf, errBufLen,
-                 "Failed to build res record for the servers %ld ... on port %d",
+                 "Failed to build res record for the servers %lu ... on port %d",
                  m_servers.x_server_ip[0], m_servers.x_dns_server_port[0]);
 
     return errBuf;
@@ -742,7 +691,6 @@ SplitDNSRecord::Init(matcher_line * line
   /* -----------------------------------------------------
      Process any modifiers to the directive, if they exist
      ----------------------------------------------------- */
-
   if (line_info->num_el > 0) {
 
     tmp = ProcessModifiers(line_info);
@@ -764,10 +712,10 @@ SplitDNSRecord::Init(matcher_line * line
 /* --------------------------------------------------------------
     SplitDNSRecord::UpdateMatch()
    -------------------------------------------------------------- */
-
 void
 SplitDNSRecord::UpdateMatch(SplitDNSResult * result, RD * rdata)
 {
+  NOWARN_UNUSED(rdata);
   int last_number = result->m_line_number;
   if ((last_number<0) || (last_number> this->line_num)) {
 
@@ -779,11 +727,9 @@ SplitDNSRecord::UpdateMatch(SplitDNSResu
 }
 
 
-
 /* --------------------------------------------------------------
     SplitDNSRecord::Print()
    -------------------------------------------------------------- */
-
 void
 SplitDNSRecord::Print()
 {
@@ -801,18 +747,11 @@ SplitDNSRecord::Print()
 
 
 /* --------------------------------------------------------------
-   -------------------------------------------------------------- */
-
-
-
-/* --------------------------------------------------------------
     SplitDNSRecord* createDefaultServer()
    -------------------------------------------------------------- */
-
 SplitDNSRecord *
 createDefaultServer()
 {
-
   SplitDNSRecord *newRec;
 
   ink_res_state res = new __ink_res_state;
@@ -849,11 +788,9 @@ createDefaultServer()
 }
 
 
-
 /* --------------------------------------------------------------
     void * splitDNS_CB()
    -------------------------------------------------------------- */
-
 void
 splitDNS_CB(const char *token, RecDataT data_type, RecData value, void *data)
 {
@@ -862,24 +799,22 @@ splitDNS_CB(const char *token, RecDataT 
   (void) value;
   (void) data;
   eventProcessor.schedule_imm(NEW(new SDNS_UpdateContinuation(reconfig_mutex)), ET_CALL);
-
 }
 
 
-/* --------------------------------------------------------------
-   -------------------------------------------------------------- */
-
 class SplitDNSConfigInfoReleaser:public Continuation
 {
 public:
   SplitDNSConfigInfoReleaser(unsigned int id, SplitDNSConfigInfo * info)
-  : Continuation(new_ProxyMutex()), m_id(id), m_info(info)
+    : Continuation(new_ProxyMutex()), m_id(id), m_info(info)
   {
     SET_HANDLER(&SplitDNSConfigInfoReleaser::handle_event);
   }
 
   int handle_event(int event, void *edata)
   {
+    NOWARN_UNUSED(event);
+    NOWARN_UNUSED(edata);
     SplitDNSconfigProcessor.release(m_id, m_info);
     delete this;
     return 0;
@@ -891,7 +826,7 @@ public:
 };
 
 SplitDNSConfigProcessor::SplitDNSConfigProcessor()
-:ninfos(0)
+ : ninfos(0)
 {
   int i;
 
@@ -992,8 +927,7 @@ ink_split_dns_init(ModuleVersion v)
 
   IOCORE_RegisterConfigString(RECT_CONFIG, sdns_def_domain, 0, RECU_DYNAMIC, RECC_NULL, NULL);
 
-  IOCORE_RegisterConfigString(RECT_CONFIG,
-                              sdns_file_var, "proxy.config.dns.splitdns.filename", RECU_DYNAMIC,
RECC_NULL, NULL);
+  IOCORE_RegisterConfigString(RECT_CONFIG, sdns_file_var, "proxy.config.dns.splitdns.filename",
RECU_DYNAMIC, RECC_NULL, NULL);
 }
 
 #endif // SPLIT_DNS

Modified: trafficserver/traffic/trunk/iocore/hostdb/HostDB.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/hostdb/HostDB.cc?rev=982071&r1=982070&r2=982071&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/hostdb/HostDB.cc (original)
+++ trafficserver/traffic/trunk/iocore/hostdb/HostDB.cc Tue Aug  3 23:21:56 2010
@@ -179,7 +179,7 @@ HostDBProcessor::cache()
 }
 
 
-struct HostDBTestRR:Continuation
+struct HostDBTestRR: public Continuation
 {
   int fd;
   char b[512];
@@ -244,7 +244,7 @@ HostDBTestRR():Continuation(new_ProxyMut
 };
 
 
-struct HostDBSyncer:Continuation
+struct HostDBSyncer: public Continuation
 {
   int frequency;
   ink_hrtime start_time;
@@ -721,14 +721,15 @@ HostDBProcessor::getby(Continuation * co
   if (!aforce_dns) {
     // find the partition lock
     //
-    ProxyMutex *mutex = hostDB.lock_for_bucket((int) (fold_md5(md5) % hostDB.buckets));
-    MUTEX_TRY_LOCK(lock, mutex, thread);
+    // TODO: Could we reuse the "mutex" above safely? I think so, but not sure.
+    ProxyMutex *bmutex = hostDB.lock_for_bucket((int) (fold_md5(md5) % hostDB.buckets));
+    MUTEX_TRY_LOCK(lock, bmutex, thread);
     MUTEX_TRY_LOCK(lock2, cont->mutex, thread);
 
     // If we can get the lock and a level 1 probe succeeds, return
     //
     if (lock && lock2) {
-      HostDBInfo *r = probe(mutex, md5, hostname, len, ip, port, pDS);
+      HostDBInfo *r = probe(bmutex, md5, hostname, len, ip, port, pDS);
       if (r) {
         Debug("hostdb", "immediate answer for %s", hostname ? hostname : "<addr>");
         HOSTDB_INCREMENT_DYN_STAT(hostdb_total_hits_stat);
@@ -742,7 +743,7 @@ HostDBProcessor::getby(Continuation * co
 Lretry:
   // Otherwise, create a continuation to do a deeper probe in the background
   //
-  HostDBContinuation * c = hostDBContAllocator.alloc();
+  HostDBContinuation *c = hostDBContAllocator.alloc();
   c->init(hostname, len, ip, port, md5, cont, pDS, false, dns_lookup_timeout);
   c->action = cont;
   c->force_dns = aforce_dns;
@@ -1040,6 +1041,8 @@ HostDBProcessor::setby(char *hostname, i
 int
 HostDBContinuation::setbyEvent(int event, Event * e)
 {
+  NOWARN_UNUSED(event);
+  NOWARN_UNUSED(e);
   HostDBInfo *r = probe(mutex, md5, name, namelen, ip, port, 0);
 
   if (r)
@@ -1148,6 +1151,7 @@ HostDBProcessor::failed_connect_on_ip_fo
 int
 HostDBContinuation::removeEvent(int event, Event * e)
 {
+  NOWARN_UNUSED(event);
   Continuation *cont = action.continuation;
 
   MUTEX_TRY_LOCK(lock, cont ? (ProxyMutex *) cont->mutex : (ProxyMutex *) NULL, e->ethread);
@@ -1545,6 +1549,7 @@ HostDBContinuation::make_get_message(cha
 //
 bool HostDBContinuation::do_get_response(Event * e)
 {
+  NOWARN_UNUSED(e);
   if (!hostdb_cluster)
     return false;
 
@@ -1682,6 +1687,7 @@ HostDBContinuation::do_put_response(Clus
 int
 HostDBContinuation::probeEvent(int event, Event * e)
 {
+  NOWARN_UNUSED(event);
   ink_assert(!link.prev && !link.next);
   EThread *t = e ? e->ethread : this_ethread();
 
@@ -1841,6 +1847,7 @@ HostDBContinuation::do_dns()
 int
 HostDBContinuation::clusterResponseEvent(int event, Event * e)
 {
+  NOWARN_UNUSED(event);
   if (from_cont) {
     HostDBContinuation *c;
     for (c = (HostDBContinuation *) remoteHostDBQueue[key_partition()].head; c; c = (HostDBContinuation
*) c->link.next)
@@ -1956,6 +1963,7 @@ HostDBContinuation::failed_cluster_reque
 void
 get_hostinfo_ClusterFunction(ClusterMachine * from, void *data, int len)
 {
+  NOWARN_UNUSED(len);
   void *pDS = 0;
   HostDB_get_message *msg = (HostDB_get_message *) data;
 
@@ -1996,6 +2004,7 @@ get_hostinfo_ClusterFunction(ClusterMach
 void
 put_hostinfo_ClusterFunction(ClusterMachine * from, void *data, int len)
 {
+  NOWARN_UNUSED(len);
   HostDB_put_message *msg = (HostDB_put_message *) data;
   HostDBContinuation *c = hostDBContAllocator.alloc();
 
@@ -2021,6 +2030,8 @@ put_hostinfo_ClusterFunction(ClusterMach
 int
 HostDBContinuation::backgroundEvent(int event, Event * e)
 {
+  NOWARN_UNUSED(event);
+  NOWARN_UNUSED(e);
   hostdb_current_interval++;
 
   return EVENT_CONT;
@@ -2028,6 +2039,7 @@ HostDBContinuation::backgroundEvent(int 
 
 bool HostDBInfo::match(INK_MD5 & md5, int bucket, int buckets)
 {
+  NOWARN_UNUSED(buckets);
   if (md5[1] != md5_high)
     return false;
 
@@ -2122,7 +2134,7 @@ HostDBContinuation::master_machine(Clust
 #ifdef NON_MODULAR
 struct ShowHostDB;
 typedef int (ShowHostDB::*ShowHostDBEventHandler) (int event, Event * data);
-struct ShowHostDB:ShowCont
+struct ShowHostDB: public ShowCont
 {
   char *name;
   unsigned int ip;
@@ -2148,6 +2160,8 @@ struct ShowHostDB:ShowCont
 
   int showLookup(int event, Event * e)
   {
+    NOWARN_UNUSED(event);
+    NOWARN_UNUSED(e);
     SET_HANDLER(&ShowHostDB::showLookupDone);
     if (name)
       hostDBProcessor.getbyname_re(this, name, 0, force ? HostDBProcessor::HOSTDB_FORCE_DNS_ALWAYS
: 0);
@@ -2266,7 +2280,7 @@ register_ShowHostDB(Continuation * c, HT
 
 struct HostDBTestReverse;
 typedef int (HostDBTestReverse::*HostDBTestReverseHandler) (int, void *);
-struct HostDBTestReverse:Continuation
+struct HostDBTestReverse: public Continuation
 {
   int outstanding;
   int total;

Modified: trafficserver/traffic/trunk/iocore/hostdb/P_HostDBProcessor.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/hostdb/P_HostDBProcessor.h?rev=982071&r1=982070&r2=982071&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/hostdb/P_HostDBProcessor.h (original)
+++ trafficserver/traffic/trunk/iocore/hostdb/P_HostDBProcessor.h Tue Aug  3 23:21:56 2010
@@ -133,7 +133,7 @@ RecSetRawStatCount(hostdb_rsb, _x, _coun
 //
 // HostDBCache (Private)
 //
-struct HostDBCache:MultiCache<HostDBInfo>
+struct HostDBCache: public MultiCache<HostDBInfo>
 {
   int rebuild_callout(HostDBInfo * e, RebuildMC & r);
   int start(int flags = 0);
@@ -271,7 +271,7 @@ HostDBRoundRobin::select_best_http(unsig
 struct HostDBContinuation;
 typedef int (HostDBContinuation::*HostDBContHandler) (int, void *);
 
-struct HostDBContinuation:Continuation
+struct HostDBContinuation: public Continuation
 {
 
   Action action;

Modified: trafficserver/traffic/trunk/iocore/hostdb/P_MultiCache.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/hostdb/P_MultiCache.h?rev=982071&r1=982070&r2=982071&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/hostdb/P_MultiCache.h (original)
+++ trafficserver/traffic/trunk/iocore/hostdb/P_MultiCache.h Tue Aug  3 23:21:56 2010
@@ -197,7 +197,7 @@ typedef int two_ints[2];
 
 struct MultiCacheHeapGC;
 
-struct MultiCacheBase:MultiCacheHeader
+struct MultiCacheBase: public MultiCacheHeader
 {
   Store *store;
   char filename[PATH_NAME_MAX + 1];
@@ -427,7 +427,7 @@ struct MultiCacheBase:MultiCacheHeader
   PtrMutex locks[MULTI_CACHE_PARTITIONS];       // 1 lock per (buckets/partitions)
 };
 
-template<class C> struct MultiCache:MultiCacheBase
+template<class C> struct MultiCache: public MultiCacheBase
 {
   int get_elementsize()
   {

Modified: trafficserver/traffic/trunk/iocore/utils/I_OneWayTunnel.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/utils/I_OneWayTunnel.h?rev=982071&r1=982070&r2=982071&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/utils/I_OneWayTunnel.h (original)
+++ trafficserver/traffic/trunk/iocore/utils/I_OneWayTunnel.h Tue Aug  3 23:21:56 2010
@@ -62,7 +62,7 @@ typedef void (*Transform_fn) (MIOBufferA
   connection which it may manipulate in any manner it sees fit.
 
 */
-struct OneWayTunnel:Continuation
+struct OneWayTunnel: public Continuation
 {
   //
   //  Public Interface

Modified: trafficserver/traffic/trunk/proxy/Show.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/Show.h?rev=982071&r1=982070&r2=982071&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/Show.h (original)
+++ trafficserver/traffic/trunk/proxy/Show.h Tue Aug  3 23:21:56 2010
@@ -124,6 +124,7 @@ struct ShowCont: public Continuation
 
 ShowCont(Continuation * c, HTTPHdr * h):
   Continuation(NULL), iarg(0), sarg(0) {
+    NOWARN_UNUSED(h);
     mutex = c->mutex;
     action = c;
     buf = (char *) xmalloc(32000);

Modified: trafficserver/traffic/trunk/proxy/http2/HttpTransactCache.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/HttpTransactCache.h?rev=982071&r1=982070&r2=982071&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/HttpTransactCache.h (original)
+++ trafficserver/traffic/trunk/proxy/http2/HttpTransactCache.h Tue Aug  3 23:21:56 2010
@@ -94,7 +94,7 @@ enum Variability_t
 enum ContentEncoding
 {
   NO_GZIP = 0,
-  GZIP,
+  GZIP
 };
 
 



Mime
View raw message