trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject svn commit: r982069 - in /trafficserver/traffic/trunk: iocore/aio/ iocore/net/ proxy/
Date Tue, 03 Aug 2010 23:21:45 GMT
Author: zwoop
Date: Tue Aug  3 23:21:45 2010
New Revision: 982069

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

Modified:
    trafficserver/traffic/trunk/iocore/aio/AIO.cc
    trafficserver/traffic/trunk/iocore/aio/I_AIO.h
    trafficserver/traffic/trunk/iocore/aio/P_AIO.h
    trafficserver/traffic/trunk/iocore/net/SSLNet.cc
    trafficserver/traffic/trunk/iocore/net/SSLNetVConnection.cc
    trafficserver/traffic/trunk/iocore/net/UnixNet.cc
    trafficserver/traffic/trunk/iocore/net/UnixNetPages.cc
    trafficserver/traffic/trunk/iocore/net/UnixNetProcessor.cc
    trafficserver/traffic/trunk/iocore/net/UnixNetVConnection.cc
    trafficserver/traffic/trunk/iocore/net/UnixUDPNet.cc
    trafficserver/traffic/trunk/proxy/Show.h

Modified: trafficserver/traffic/trunk/iocore/aio/AIO.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/aio/AIO.cc?rev=982069&r1=982068&r2=982069&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/aio/AIO.cc (original)
+++ trafficserver/traffic/trunk/iocore/aio/AIO.cc Tue Aug  3 23:21:45 2010
@@ -61,6 +61,7 @@ static void aio_move(AIO_Reqs *req);
 static int
 aio_stats_cb(const char *name, RecDataT data_type, RecData *data, RecRawStatBlock *rsb, int
id)
 {
+  NOWARN_UNUSED(name);
   (void) data_type;
   (void) rsb;
   int64 new_val = 0;
@@ -131,7 +132,7 @@ AIOCallback *
 new_AIOCallback(void)
 {
   return new AIOCallbackInternal;
-};
+}
 
 void
 ink_aio_set_callback(Continuation *callback)
@@ -416,26 +417,22 @@ int
 ink_aio_read(AIOCallback *op, int fromAPI)
 {
   op->aiocb.aio_lio_opcode = LIO_READ;
-  switch (AIO_MODE) {
+
 #if (AIO_MODE == AIO_MODE_AIO)
-  case AIO_MODE_AIO:
-    ink_debug_assert(this_ethread() == op->thread);
-    op->thread->aio_ops.enqueue(op);
-    if (aio_read(&op->aiocb) < 0) {
-      Warning("failed aio_read: %s\n", strerror(errno));
-      op->thread->aio_ops.remove(op);
-      return -1;
-    }
-    break;
+  ink_debug_assert(this_ethread() == op->thread);
+  op->thread->aio_ops.enqueue(op);
+  if (aio_read(&op->aiocb) < 0) {
+    Warning("failed aio_read: %s\n", strerror(errno));
+    op->thread->aio_ops.remove(op);
+    return -1;
+  }
+#elif (AIO_MODE == AIO_MODE_SYNC)
+  cache_op((AIOCallbackInternal *) op);
+  op->action.continuation->handleEvent(AIO_EVENT_DONE, op);
+#elif (AIO_MODE == AIO_MODE_THREAD)
+  aio_queue_req((AIOCallbackInternal *) op, fromAPI);
 #endif
-  case AIO_MODE_SYNC:
-    cache_op((AIOCallbackInternal *) op);
-    op->action.continuation->handleEvent(AIO_EVENT_DONE, op);
-    break;
-  case AIO_MODE_THREAD:
-    aio_queue_req((AIOCallbackInternal *) op, fromAPI);
-    break;
-  }
+
   return 1;
 }
 
@@ -443,26 +440,22 @@ int
 ink_aio_write(AIOCallback *op, int fromAPI)
 {
   op->aiocb.aio_lio_opcode = LIO_WRITE;
-  switch (AIO_MODE) {
+
 #if (AIO_MODE == AIO_MODE_AIO)
-  case AIO_MODE_AIO:
-    ink_debug_assert(this_ethread() == op->thread);
-    op->thread->aio_ops.enqueue(op);
-    if (aio_write(&op->aiocb) < 0) {
-      Warning("failed aio_write: %s\n", strerror(errno));
-      op->thread->aio_ops.remove(op);
-      return -1;
-    }
-    break;
+  ink_debug_assert(this_ethread() == op->thread);
+  op->thread->aio_ops.enqueue(op);
+  if (aio_write(&op->aiocb) < 0) {
+    Warning("failed aio_write: %s\n", strerror(errno));
+    op->thread->aio_ops.remove(op);
+    return -1;
+  }
+#elif (AIO_MODE == AIO_MODE_SYNC)
+  cache_op((AIOCallbackInternal *) op);
+  op->action.continuation->handleEvent(AIO_EVENT_DONE, op);
+#elif (AIO_MODE == AIO_MODE_THREAD)
+  aio_queue_req((AIOCallbackInternal *) op, fromAPI);
 #endif
-  case AIO_MODE_SYNC:
-    cache_op((AIOCallbackInternal *) op);
-    op->action.continuation->handleEvent(AIO_EVENT_DONE, op);
-    break;
-  case AIO_MODE_THREAD:
-    aio_queue_req((AIOCallbackInternal *) op, fromAPI);
-    break;
-  }
+
   return 1;
 }
 

Modified: trafficserver/traffic/trunk/iocore/aio/I_AIO.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/aio/I_AIO.h?rev=982069&r1=982068&r2=982069&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/aio/I_AIO.h (original)
+++ trafficserver/traffic/trunk/iocore/aio/I_AIO.h Tue Aug  3 23:21:45 2010
@@ -59,7 +59,7 @@
 #define AIO_LOWEST_PRIORITY      0
 #define AIO_DEFAULT_PRIORITY     AIO_LOWEST_PRIORITY
 
-struct AIOCallback:Continuation
+struct AIOCallback: public Continuation
 {
   // set before calling aio_read/aio_write
   ink_aiocb_t aiocb;

Modified: trafficserver/traffic/trunk/iocore/aio/P_AIO.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/aio/P_AIO.h?rev=982069&r1=982068&r2=982069&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/aio/P_AIO.h (original)
+++ trafficserver/traffic/trunk/iocore/aio/P_AIO.h Tue Aug  3 23:21:45 2010
@@ -48,7 +48,7 @@
 						    PRIVATE_MODULE_HEADER)
 struct AIO_Reqs;
 
-struct AIOCallbackInternal:AIOCallback
+struct AIOCallbackInternal: public AIOCallback
 {
   AIOCallback *first;
   AIO_Reqs *aio_req;
@@ -69,7 +69,7 @@ TS_INLINE int
 AIOCallback::ok()
 {
   return (off_t) aiocb.aio_nbytes == (off_t) aio_result;
-};
+}
 
 TS_INLINE int
 AIOCallbackInternal::io_complete(int event, void *data)
@@ -79,7 +79,7 @@ AIOCallbackInternal::io_complete(int eve
   if (!action.cancelled)
     action.continuation->handleEvent(AIO_EVENT_DONE, this);
   return EVENT_DONE;
-};
+}
 
 struct AIO_Reqs
 {

Modified: trafficserver/traffic/trunk/iocore/net/SSLNet.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/SSLNet.cc?rev=982069&r1=982068&r2=982069&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/SSLNet.cc (original)
+++ trafficserver/traffic/trunk/iocore/net/SSLNet.cc Tue Aug  3 23:21:45 2010
@@ -168,6 +168,7 @@ SSLNetProcessor::reconfigure(void)
 void
 sslLockingCallback(int mode, int type, const char *file, int line)
 {
+  NOWARN_UNUSED(file);
   (void) line;
   if (mode & CRYPTO_LOCK) {
     MUTEX_TAKE_LOCK(ssl_NetProcessor.sslMutexArray[type], this_ethread());

Modified: trafficserver/traffic/trunk/iocore/net/SSLNetVConnection.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/SSLNetVConnection.cc?rev=982069&r1=982068&r2=982069&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/SSLNetVConnection.cc (original)
+++ trafficserver/traffic/trunk/iocore/net/SSLNetVConnection.cc Tue Aug  3 23:21:45 2010
@@ -62,6 +62,7 @@ do_SSL_write(SSL * ssl, void *buf, int s
 static int
 ssl_read_from_net(NetHandler * nh, UnixNetVConnection * vc, EThread * lthread, int &ret)
 {
+  NOWARN_UNUSED(nh);
   NetState *s = &vc->read;
   SSLNetVConnection *sslvc = (SSLNetVConnection *) vc;
   MIOBufferAccessor & buf = s->vio.buffer;

Modified: trafficserver/traffic/trunk/iocore/net/UnixNet.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/UnixNet.cc?rev=982069&r1=982068&r2=982069&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/UnixNet.cc (original)
+++ trafficserver/traffic/trunk/iocore/net/UnixNet.cc Tue Aug  3 23:21:45 2010
@@ -192,6 +192,7 @@ net_signal_hook_function(EThread *thread
 void
 initialize_thread_for_net(EThread *thread, int thread_index)
 {
+  NOWARN_UNUSED(thread_index);
   static bool poll_delay_read = false;
   int max_poll_delay;           // max poll delay in milliseconds
   if (!poll_delay_read) {
@@ -258,6 +259,7 @@ NetHandler::startNetEvent(int event, Eve
 void
 NetHandler::process_enabled_list(NetHandler *nh, EThread *t)
 {
+  NOWARN_UNUSED(t);
   UnixNetVConnection *vc = NULL;
 
   SListM(UnixNetVConnection, NetState, read, enable_link) rq(nh->read_enable_list.popall());

Modified: trafficserver/traffic/trunk/iocore/net/UnixNetPages.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/UnixNetPages.cc?rev=982069&r1=982068&r2=982069&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/UnixNetPages.cc (original)
+++ trafficserver/traffic/trunk/iocore/net/UnixNetPages.cc Tue Aug  3 23:21:45 2010
@@ -30,7 +30,7 @@
 
 struct ShowNet;
 typedef int (ShowNet::*ShowNetEventHandler) (int event, Event * data);
-struct ShowNet:ShowCont
+struct ShowNet: public ShowCont
 {
   int ithread;
   int port;

Modified: trafficserver/traffic/trunk/iocore/net/UnixNetProcessor.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/UnixNetProcessor.cc?rev=982069&r1=982068&r2=982069&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/UnixNetProcessor.cc (original)
+++ trafficserver/traffic/trunk/iocore/net/UnixNetProcessor.cc Tue Aug  3 23:21:45 2010
@@ -244,6 +244,7 @@ UnixNetProcessor::connect(Continuation *
                           UnixNetVConnection ** avc,
                           unsigned int ip, int port, NetVCOptions * opt)
 {
+  NOWARN_UNUSED(avc);
   return connect_re(cont, ip, port, opt);
 }
 

Modified: trafficserver/traffic/trunk/iocore/net/UnixNetVConnection.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/UnixNetVConnection.cc?rev=982069&r1=982068&r2=982069&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/UnixNetVConnection.cc (original)
+++ trafficserver/traffic/trunk/iocore/net/UnixNetVConnection.cc Tue Aug  3 23:21:45 2010
@@ -360,6 +360,7 @@ read_from_net(NetHandler *nh, UnixNetVCo
 void
 write_to_net(NetHandler *nh, UnixNetVConnection *vc, PollDescriptor *pd, EThread *thread)
 {
+  NOWARN_UNUSED(pd);
   ProxyMutex *mutex = thread->mutex;
 
   NET_DEBUG_COUNT_DYN_STAT(net_calls_to_writetonet_stat, 1);

Modified: trafficserver/traffic/trunk/iocore/net/UnixUDPNet.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/UnixUDPNet.cc?rev=982069&r1=982068&r2=982069&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/UnixUDPNet.cc (original)
+++ trafficserver/traffic/trunk/iocore/net/UnixUDPNet.cc Tue Aug  3 23:21:45 2010
@@ -123,6 +123,7 @@ void
 UDPNetProcessorInternal::udp_read_from_net(UDPNetHandler * nh,
                                            UDPConnection * xuc, PollDescriptor * pd, EThread
* thread)
 {
+  NOWARN_UNUSED(pd);
   (void) thread;
   UnixUDPConnection *uc = (UnixUDPConnection *) xuc;
 
@@ -920,12 +921,9 @@ UDPQueue::service(UDPNetHandler * nh)
     // if (bytesSent > 0)
     // timespent is in milli-seconds
     char temp[2048], *p1;
-    char bwMessage[2048];
     double bw, totalBw;
-    unsigned char *ip;
 
     temp[0] = '\0';
-    bwMessage[0] = '\0';
     p1 = temp;
 
     if (bytesSent > 0)
@@ -941,7 +939,6 @@ UDPQueue::service(UDPNetHandler * nh)
                G_inkPipeInfo.perPipeInfo[i].wt, bw / totalBw);
       p1 += strlen(p1);
 
-      ip = (unsigned char *) &(G_inkPipeInfo.perPipeInfo[i].destIP);
       // use a weighted estimator of current usage
       G_inkPipeInfo.perPipeInfo[i].bwUsed = (4.0 * G_inkPipeInfo.perPipeInfo[i].bwUsed /
5.0) + (bw / 5.0);
       G_inkPipeInfo.perPipeInfo[i].bytesSent = 0;
@@ -1280,6 +1277,8 @@ UDPWorkContinuation::init(Continuation *
 int
 UDPWorkContinuation::StateCreatePortPairs(int event, void *data)
 {
+  NOWARN_UNUSED(event);
+  NOWARN_UNUSED(data);
 //  int res = 0;
   int numUdpPorts = 2 * numPairs;
   int fd1 = -1, fd2 = -1;
@@ -1388,6 +1387,8 @@ out:
 int
 UDPWorkContinuation::StateDoCallback(int event, void *data)
 {
+  NOWARN_UNUSED(event);
+  NOWARN_UNUSED(data);
   MUTEX_TRY_LOCK(lock, action.mutex, this_ethread());
   if (!lock) {
     this_ethread()->schedule_in(this, MUTEX_RETRY_DELAY);

Modified: trafficserver/traffic/trunk/proxy/Show.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/Show.h?rev=982069&r1=982068&r2=982069&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/Show.h (original)
+++ trafficserver/traffic/trunk/proxy/Show.h Tue Aug  3 23:21:45 2010
@@ -37,7 +37,7 @@
 
 struct ShowCont;
 typedef int (ShowCont::*ShowContEventHandler) (int event, Event * data);
-struct ShowCont:Continuation
+struct ShowCont: public Continuation
 {
   Action action;
   char *buf, *start, *ebuf;
@@ -111,6 +111,9 @@ struct ShowCont:Continuation
 
   virtual int done(int e, int event, void *data)
   {
+    NOWARN_UNUSED(e);
+    NOWARN_UNUSED(event);
+    NOWARN_UNUSED(data);
     if (sarg) {
       xfree(sarg);
       sarg = NULL;



Mime
View raw message