You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2015/07/16 17:57:27 UTC

[1/2] trafficserver git commit: Revert "TS-3761 Fix version.c example to build properly with tsxs"

Repository: trafficserver
Updated Branches:
  refs/heads/master 26f983de3 -> a7a95706f


Revert "TS-3761 Fix version.c example to build properly with tsxs"

This reverts commit 691a49abceb3bab3ffa1998b94995489536626d1.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/abfe8cdb
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/abfe8cdb
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/abfe8cdb

Branch: refs/heads/master
Commit: abfe8cdb157fa14fa6d818696e9442d31eacf0f7
Parents: 26f983d
Author: Leif Hedstrom <zw...@apache.org>
Authored: Thu Jul 16 09:25:40 2015 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Thu Jul 16 09:26:07 2015 -0600

----------------------------------------------------------------------
 example/version/version.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/abfe8cdb/example/version/version.c
----------------------------------------------------------------------
diff --git a/example/version/version.c b/example/version/version.c
index edff116..f5c8126 100644
--- a/example/version/version.c
+++ b/example/version/version.c
@@ -24,9 +24,10 @@
 #include <stdio.h>
 
 #include "ts/ts.h"
+#include "ts/ink_defs.h"
 
 void
-TSPluginInit(int argc, const char *argv[])
+TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
 {
   TSPluginRegistrationInfo info;
 


[2/2] trafficserver git commit: clang-format ... Also, why was there no Jira with these changes?

Posted by zw...@apache.org.
clang-format ... Also, why was there no Jira with these changes?


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/a7a95706
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/a7a95706
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/a7a95706

Branch: refs/heads/master
Commit: a7a95706f7ac242d09bd14396c6f02ee83b85d2e
Parents: abfe8cd
Author: Leif Hedstrom <zw...@apache.org>
Authored: Thu Jul 16 09:57:19 2015 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Thu Jul 16 09:57:19 2015 -0600

----------------------------------------------------------------------
 iocore/hostdb/HostDB.cc           | 54 ++++++++++++++++++----------------
 iocore/hostdb/I_HostDBProcessor.h |  2 +-
 iocore/hostdb/P_HostDBProcessor.h |  3 +-
 3 files changed, 31 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a7a95706/iocore/hostdb/HostDB.cc
----------------------------------------------------------------------
diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc
index df302d7..f0319aa 100644
--- a/iocore/hostdb/HostDB.cc
+++ b/iocore/hostdb/HostDB.cc
@@ -1838,30 +1838,32 @@ HostDBContinuation::iterateEvent(int event, Event *e)
 
   // let's iterate through another record and then reschedule ourself.
   if (current_iterate_pos < hostDB.buckets) {
-     // do 100 at a time
-     int end = min(current_iterate_pos + 100, hostDB.buckets);
-     for (; current_iterate_pos < end; ++current_iterate_pos) {
-       ProxyMutex *bucket_mutex = hostDB.lock_for_bucket(current_iterate_pos);
-       MUTEX_TRY_LOCK_FOR(lock_bucket, bucket_mutex, t, this);
-       if (!lock_bucket.is_locked()) {
-         // we couldn't get the bucket lock, let's just reschedule and try later.
-         Debug("hostdb", "iterateEvent event=%d eventp=%p: reschedule due to not getting bucket mutex", event, e);
-         mutex->thread_holding->schedule_in(this, HOST_DB_RETRY_PERIOD);
-         return EVENT_CONT;
-       }
-
-       for (unsigned int l = 0; l < hostDB.levels; ++l) {
-         HostDBInfo *r = reinterpret_cast<HostDBInfo*>(hostDB.data + hostDB.level_offset[l] + hostDB.bucketsize[l] * current_iterate_pos);
-         if (!r->deleted && !r->failed()) {
-           action.continuation->handleEvent(EVENT_INTERVAL, static_cast<void*>(r));
-         }
-       }
-     }
-
-     // And reschedule ourselves to pickup the next bucket after HOST_DB_RETRY_PERIOD.
-     Debug("hostdb", "iterateEvent event=%d eventp=%p: completed current iteration %d of %d", event, e, current_iterate_pos, hostDB.buckets);
-     mutex->thread_holding->schedule_in(this, HOST_DB_ITERATE_PERIOD);
-     return EVENT_CONT;
+    // do 100 at a time
+    int end = min(current_iterate_pos + 100, hostDB.buckets);
+    for (; current_iterate_pos < end; ++current_iterate_pos) {
+      ProxyMutex *bucket_mutex = hostDB.lock_for_bucket(current_iterate_pos);
+      MUTEX_TRY_LOCK_FOR(lock_bucket, bucket_mutex, t, this);
+      if (!lock_bucket.is_locked()) {
+        // we couldn't get the bucket lock, let's just reschedule and try later.
+        Debug("hostdb", "iterateEvent event=%d eventp=%p: reschedule due to not getting bucket mutex", event, e);
+        mutex->thread_holding->schedule_in(this, HOST_DB_RETRY_PERIOD);
+        return EVENT_CONT;
+      }
+
+      for (unsigned int l = 0; l < hostDB.levels; ++l) {
+        HostDBInfo *r =
+          reinterpret_cast<HostDBInfo *>(hostDB.data + hostDB.level_offset[l] + hostDB.bucketsize[l] * current_iterate_pos);
+        if (!r->deleted && !r->failed()) {
+          action.continuation->handleEvent(EVENT_INTERVAL, static_cast<void *>(r));
+        }
+      }
+    }
+
+    // And reschedule ourselves to pickup the next bucket after HOST_DB_RETRY_PERIOD.
+    Debug("hostdb", "iterateEvent event=%d eventp=%p: completed current iteration %d of %d", event, e, current_iterate_pos,
+          hostDB.buckets);
+    mutex->thread_holding->schedule_in(this, HOST_DB_ITERATE_PERIOD);
+    return EVENT_CONT;
   } else {
     Debug("hostdb", "iterateEvent event=%d eventp=%p: completed FINAL iteration %d", event, e, current_iterate_pos);
     // if there are no more buckets, then we're done.
@@ -2413,7 +2415,7 @@ struct ShowHostDB : public ShowCont {
   }
 
   int
-  showAll(int event , Event *e)
+  showAll(int event, Event *e)
   {
     CHECK_SHOW(begin("HostDB All Records"));
     CHECK_SHOW(show("<hr>"));
@@ -2427,7 +2429,7 @@ struct ShowHostDB : public ShowCont {
   {
     if (event == EVENT_INTERVAL) {
       HostDBInfo *r = reinterpret_cast<HostDBInfo *>(e);
-      return showOne(r,false,event,e);
+      return showOne(r, false, event, e);
     } else if (event == EVENT_DONE) {
       return complete(event, e);
     } else {

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a7a95706/iocore/hostdb/I_HostDBProcessor.h
----------------------------------------------------------------------
diff --git a/iocore/hostdb/I_HostDBProcessor.h b/iocore/hostdb/I_HostDBProcessor.h
index f5acf1f..ffebfe4 100644
--- a/iocore/hostdb/I_HostDBProcessor.h
+++ b/iocore/hostdb/I_HostDBProcessor.h
@@ -418,7 +418,7 @@ struct HostDBCache;
 typedef void (Continuation::*process_hostdb_info_pfn)(HostDBInfo *r);
 typedef void (Continuation::*process_srv_info_pfn)(HostDBInfo *r);
 
-  Action *iterate(Continuation *cont);
+Action *iterate(Continuation *cont);
 
 /** The Host Databse access interface. */
 struct HostDBProcessor : public Processor {

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a7a95706/iocore/hostdb/P_HostDBProcessor.h
----------------------------------------------------------------------
diff --git a/iocore/hostdb/P_HostDBProcessor.h b/iocore/hostdb/P_HostDBProcessor.h
index 54c938a..5cfa025 100644
--- a/iocore/hostdb/P_HostDBProcessor.h
+++ b/iocore/hostdb/P_HostDBProcessor.h
@@ -538,7 +538,8 @@ struct HostDBContinuation : public Continuation {
 
   HostDBContinuation()
     : Continuation(NULL), ttl(0), host_res_style(DEFAULT_OPTIONS.host_res_style), dns_lookup_timeout(DEFAULT_OPTIONS.timeout),
-      timeout(0), from(0), from_cont(0), probe_depth(0), current_iterate_pos(0), missing(false), force_dns(DEFAULT_OPTIONS.force_dns), round_robin(false)
+      timeout(0), from(0), from_cont(0), probe_depth(0), current_iterate_pos(0), missing(false),
+      force_dns(DEFAULT_OPTIONS.force_dns), round_robin(false)
   {
     ink_zero(md5_host_name_store);
     ink_zero(md5.hash);