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 2014/05/23 18:13:49 UTC

git commit: [TS-2833] Remove REC_BUILD_STAND_ALONE, REC_BUILD_MGMT and REC_BUILD_STUB.

Repository: trafficserver
Updated Branches:
  refs/heads/master 7353f6690 -> b6383928a


[TS-2833] Remove REC_BUILD_STAND_ALONE, REC_BUILD_MGMT and REC_BUILD_STUB.


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

Branch: refs/heads/master
Commit: b6383928ab4b78bb5f14119ddcd7c6e214d66a7c
Parents: 7353f66
Author: Leif Hedstrom <zw...@apache.org>
Authored: Fri May 23 10:09:45 2014 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Fri May 23 10:09:45 2014 -0600

----------------------------------------------------------------------
 CHANGES                   |   3 +
 configure.ac              |   1 -
 lib/records/Makefile.am   |   2 -
 lib/records/RecCore.cc    |  18 -----
 lib/records/RecLocal.cc   |  31 -------
 lib/records/RecMessage.cc | 178 -----------------------------------------
 6 files changed, 3 insertions(+), 230 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b6383928/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 233b9d3..4f8d8af 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 5.0.0
 
+  *) [TS-2833] Remove REC_BUILD_STAND_ALONE, REC_BUILD_MGMT and
+   REC_BUILD_STUB. Dead code.
+
   *) [TS-2547] Remove Resource.c/h, and NEW as well.
 
   *) [TS-1588] slow log should include client addr

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b6383928/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 41ff592..23ead6d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -215,7 +215,6 @@ TS_ARG_ENABLE_VAR([has], [tests])
 AC_SUBST(has_tests)
 AM_CONDITIONAL([BUILD_TESTS], [test 0 -ne $has_tests])
 
-AC_SUBST([ink_with_modules_def],["-DREC_BUILD_MGMT"])
 AC_SUBST([ink_with_modules_local],["-DLOCAL_MANAGER"])
 AC_SUBST([ink_with_modules_process],["-DPROCESS_MANAGER"])
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b6383928/lib/records/Makefile.am
----------------------------------------------------------------------
diff --git a/lib/records/Makefile.am b/lib/records/Makefile.am
index 93d1d14..8c9323b 100644
--- a/lib/records/Makefile.am
+++ b/lib/records/Makefile.am
@@ -16,8 +16,6 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-DEFS += @ink_with_modules_def@
-
 AM_CPPFLAGS = \
   -I$(top_srcdir)/iocore/eventsystem \
   -I$(top_srcdir)/iocore/utils \

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b6383928/lib/records/RecCore.cc
----------------------------------------------------------------------
diff --git a/lib/records/RecCore.cc b/lib/records/RecCore.cc
index d9c1049..ca13f8a 100644
--- a/lib/records/RecCore.cc
+++ b/lib/records/RecCore.cc
@@ -1183,8 +1183,6 @@ RecConfigReadPersistentStatsPath()
 //-------------------------------------------------------------------------
 // REC_SignalManager (TS)
 //-------------------------------------------------------------------------
-#if defined (REC_BUILD_MGMT)
-
 #if defined(LOCAL_MANAGER)
 
 #include "LocalManager.h"
@@ -1218,19 +1216,3 @@ RecRegisterManagerCb(int _signal, RecManagerCb _fn, void *_data)
 }
 
 #endif // LOCAL_MANAGER
-
-#else
-
-void
-RecSignalManager(int /* id ATS_UNUSED */, const char *msg)
-{
-  RecLog(DL_Warning, msg);
-}
-
-int
-RecRegisterManagerCb(int _signal, RecManagerCb _fn, void *_data)
-{
-  return -1;
-}
-
-#endif // REC_BUILD_MGMT

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b6383928/lib/records/RecLocal.cc
----------------------------------------------------------------------
diff --git a/lib/records/RecLocal.cc b/lib/records/RecLocal.cc
index 8db081e..25ed956 100644
--- a/lib/records/RecLocal.cc
+++ b/lib/records/RecLocal.cc
@@ -56,38 +56,9 @@ i_am_the_record_owner(RecT rec_type)
 
 //-------------------------------------------------------------------------
 //
-// REC_BUILD_STAND_ALONE IMPLEMENTATION
-//
-//-------------------------------------------------------------------------
-#if defined (REC_BUILD_STAND_ALONE)
-
-
-//-------------------------------------------------------------------------
-// sync_thr
-//-------------------------------------------------------------------------
-static void *
-sync_thr(void *data)
-{
-  textBuffer tb(65536);
-  while (1) {
-    send_push_message();
-    RecSyncStatsFile();
-    if (RecSyncConfigToTB(&tb) == REC_ERR_OKAY) {
-      RecWriteConfigFile(&tb);
-    }
-    usleep(REC_REMOTE_SYNC_INTERVAL_MS * 1000);
-  }
-  return NULL;
-}
-
-
-//-------------------------------------------------------------------------
-//
 // REC_BUILD_MGMT IMPLEMENTATION
 //
 //-------------------------------------------------------------------------
-#elif defined (REC_BUILD_MGMT)
-
 #include "Main.h"
 
 
@@ -132,8 +103,6 @@ sync_thr(void *data)
   return NULL;
 }
 
-#endif
-
 
 //-------------------------------------------------------------------------
 // config_update_thr

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b6383928/lib/records/RecMessage.cc
----------------------------------------------------------------------
diff --git a/lib/records/RecMessage.cc b/lib/records/RecMessage.cc
index bf07841..490eeb1 100644
--- a/lib/records/RecMessage.cc
+++ b/lib/records/RecMessage.cc
@@ -36,178 +36,9 @@ static void *g_recv_cookie = NULL;
 
 //-------------------------------------------------------------------------
 //
-// REC_BUILD_STAND_ALONE IMPLEMENTATION
-//
-//-------------------------------------------------------------------------
-#if defined (REC_BUILD_STAND_ALONE)
-
-extern RecModeT g_mode_type;
-
-static LLQ *g_send_llq = NULL;
-static LLQ *g_recv_llq = NULL;
-
-//-------------------------------------------------------------------------
-// send_thr
-//-------------------------------------------------------------------------
-
-static void *
-send_thr(void *data)
-{
-  int msg_size;
-  RecMessageHdr *msg_hdr;
-  RecHandle h_pipe = (RecHandle)(intptr_t)data;
-  while (true) {
-    // dequeue will block if there's nothing in the queue
-    msg_hdr = (RecMessageHdr *) dequeue(g_send_llq);
-    msg_size = (msg_hdr->o_end - msg_hdr->o_start) + sizeof(RecMessageHdr);
-    if (RecPipeWrite(h_pipe, (char *) msg_hdr, msg_size) == REC_ERR_FAIL) {
-      ink_release_assert("Pipe write failed, message lost");
-    }
-    ats_free(msg_hdr);
-  }
-  return NULL;
-}
-
-//-------------------------------------------------------------------------
-// recv_thr
-//-------------------------------------------------------------------------
-
-static void *
-recv_thr(void *data)
-{
-  int msg_size = 0;
-  RecMessageHdr msg_hdr;
-  RecMessage *msg;
-  RecHandle h_pipe = (RecHandle)(intptr_t)data;
-  while (true) {
-    if (RecPipeRead(h_pipe, (char *) (&msg_hdr), sizeof(RecMessageHdr)) == REC_ERR_FAIL) {
-      ink_release_assert("Pipe read failed");
-    }
-    msg = (RecMessage *)ats_malloc((msg_hdr.o_end - msg_hdr.o_start) + sizeof(RecMessageHdr));
-    memcpy(msg, &msg_hdr, sizeof(RecMessageHdr));
-    if (RecPipeRead(h_pipe, (char *) (msg) + msg_hdr.o_start, msg_hdr.o_end - msg_hdr.o_start) == REC_ERR_FAIL) {
-      ink_release_assert("Pipe read failed");
-    }
-    msg_size = msg_hdr.o_end - msg_hdr.o_start + sizeof(RecMessageHdr);
-    enqueue(g_recv_llq, msg);
-  }
-  return NULL;
-}
-
-//-------------------------------------------------------------------------
-// accept_thr
-//-------------------------------------------------------------------------
-
-static void *
-accept_thr(void *data)
-{
-  xptr<char> rundir(RecConfigReadRuntimeDir());
-  RecHandle h_pipe;
-  h_pipe = RecPipeCreate(rundir, REC_PIPE_NAME);
-  ink_thread_create(send_thr, (void *) h_pipe);
-  ink_thread_create(recv_thr, (void *) h_pipe);
-  return NULL;
-}
-
-//-------------------------------------------------------------------------
-// recv_cb_thr
-//-------------------------------------------------------------------------
-
-static void *
-recv_cb_thr(void *data)
-{
-  RecMessage *msg;
-  while (true) {
-    if (g_recv_cb) {
-      msg = (RecMessage *) dequeue(g_recv_llq);
-      RecMessageRecvThis(0, (char *) msg, 0);
-      ats_free(msg);
-    }
-  }
-  return NULL;
-}
-
-//-------------------------------------------------------------------------
-// RecMessageInit
-//-------------------------------------------------------------------------
-
-int
-RecMessageInit()
-{
-
-  RecHandle h_pipe;
-
-  if (g_message_initialized) {
-    return REC_ERR_OKAY;
-  }
-
-  /*
-   * g_mode_type should be initialized by
-   * RecLocalInit() or RecProcessInit() earlier.
-   */
-  ink_assert(g_mode_type != RECM_NULL);
-
-  g_send_llq = create_queue();
-  g_recv_llq = create_queue();
-
-  switch (g_mode_type) {
-  case RECM_CLIENT:
-    h_pipe = RecPipeConnect(Layout::get()->runtimedir, REC_PIPE_NAME);
-    if (h_pipe == REC_HANDLE_INVALID) {
-      return REC_ERR_FAIL;
-    }
-    ink_thread_create(send_thr, (void *) h_pipe);
-    ink_thread_create(recv_thr, (void *) h_pipe);
-    break;
-  case RECM_SERVER:
-    ink_thread_create(accept_thr, NULL);
-    break;
-  case RECM_NULL:
-  case RECM_STAND_ALONE:
-  default:
-    ink_assert(!"Unexpected RecModeT type");
-    break;
-  }
-
-  ink_thread_create(recv_cb_thr, NULL);
-
-  g_message_initialized = true;
-
-  return REC_ERR_OKAY;
-
-}
-
-//-------------------------------------------------------------------------
-// RecMessageSend
-//-------------------------------------------------------------------------
-
-int
-RecMessageSend(RecMessage * msg)
-{
-
-  RecMessage *msg_cpy;
-  int msg_cpy_size;
-
-  // Make a copy of the record, but truncate it to the size actually used
-  if (g_mode_type == RECM_CLIENT || g_mode_type == RECM_SERVER) {
-    msg_cpy_size = sizeof(RecMessageHdr) + (msg->o_write - msg->o_start);
-    msg_cpy = (RecMessage *)ats_malloc(msg_cpy_size);
-    memcpy(msg_cpy, msg, msg_cpy_size);
-    msg_cpy->o_end = msg_cpy->o_write;
-    enqueue(g_send_llq, (void *) msg_cpy);
-  }
-
-  return REC_ERR_OKAY;
-
-}
-
-//-------------------------------------------------------------------------
-//
 // REC_BUILD_MGMT IMPLEMENTATION
 //
 //-------------------------------------------------------------------------
-#elif defined (REC_BUILD_MGMT)
-
 #if defined(LOCAL_MANAGER)
 #include "LocalManager.h"
 #elif defined(PROCESS_MANAGER)
@@ -269,15 +100,6 @@ RecMessageSend(RecMessage * msg)
   return REC_ERR_OKAY;
 }
 
-//-------------------------------------------------------------------------
-//
-// STUB IMPLEMENTATION
-//
-//-------------------------------------------------------------------------
-#elif defined (REC_BUILD_STUB)
-#else
-#error "Required #define not specificed; expected REC_BUILD_STAND_ALONE, REC_BUILD_MGMT, or REC_BUILD_STUB"
-#endif
 
 //-------------------------------------------------------------------------
 // RecMessageAlloc