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 2018/07/31 20:43:59 UTC

[trafficserver] 11/11: Removes old commented-out code

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 8.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 3af405e6867c7900f86965614d95f8997fc7ec8f
Author: Randall Meyer <ra...@yahoo.com>
AuthorDate: Mon Jun 4 10:09:41 2018 -0700

    Removes old commented-out code
    
    (cherry picked from commit 65cb22615c5abe8bcf816b94239d804375ede797)
---
 lib/records/P_RecMessage.h           |  1 -
 lib/records/RecLocal.cc              |  9 ---------
 lib/records/RecProcess.cc            | 19 -------------------
 lib/ts/ink_sock.cc                   |  1 -
 proxy/hdrs/MIME.h                    |  4 +---
 proxy/http/HttpBodyFactory.cc        |  1 -
 proxy/http/HttpSM.cc                 |  4 ----
 proxy/http/HttpTransact.h            | 11 -----------
 src/traffic_server/CoreUtils.cc      |  4 ----
 src/traffic_server/SocksProxy.cc     |  5 -----
 src/traffic_server/traffic_server.cc | 15 ++-------------
 src/traffic_top/traffic_top.cc       |  2 --
 12 files changed, 3 insertions(+), 73 deletions(-)

diff --git a/lib/records/P_RecMessage.h b/lib/records/P_RecMessage.h
index c653017..24db24c 100644
--- a/lib/records/P_RecMessage.h
+++ b/lib/records/P_RecMessage.h
@@ -29,7 +29,6 @@
 // Initialization
 //-------------------------------------------------------------------------
 
-// int RecMessageInit();
 void RecMessageRegister();
 
 //-------------------------------------------------------------------------
diff --git a/lib/records/RecLocal.cc b/lib/records/RecLocal.cc
index 3c2a4f1..c27a13a 100644
--- a/lib/records/RecLocal.cc
+++ b/lib/records/RecLocal.cc
@@ -168,15 +168,6 @@ RecLocalInit(Diags *_diags)
     return REC_ERR_FAIL;
   }
 
-  /* -- defer RecMessageInit() until LocalManager is initialized
-     if (RecMessageInit(RECM_SERVER) == REC_ERR_FAIL) {
-     return REC_ERR_FAIL;
-     }
-
-     if (RecMessageRegisterRecvCb(recv_message_cb, nullptr)) {
-     return REC_ERR_FAIL;
-     }
-   */
   initialized_p = true;
 
   return REC_ERR_OKAY;
diff --git a/lib/records/RecProcess.cc b/lib/records/RecProcess.cc
index 272d887..5859380 100644
--- a/lib/records/RecProcess.cc
+++ b/lib/records/RecProcess.cc
@@ -222,25 +222,6 @@ RecProcessInit(RecModeT mode_type, Diags *_diags)
     return REC_ERR_FAIL;
   }
 
-  /* -- defer RecMessageInit() until ProcessManager is initialized and
-   *    started
-   if (RecMessageInit(mode_type) == REC_ERR_FAIL) {
-   return REC_ERR_FAIL;
-   }
-
-   if (RecMessageRegisterRecvCb(recv_message_cb__process, nullptr)) {
-   return REC_ERR_FAIL;
-   }
-
-   ink_cond_init(&g_force_req_cond);
-   ink_mutex_init(&g_force_req_mutex);
-   if (mode_type == RECM_CLIENT) {
-   send_pull_message(RECG_PULL_REQ);
-   ink_cond_wait(&g_force_req_cond, &g_force_req_mutex);
-   ink_mutex_release(&g_force_req_mutex);
-   }
-   */
-
   initialized_p = true;
 
   return REC_ERR_OKAY;
diff --git a/lib/ts/ink_sock.cc b/lib/ts/ink_sock.cc
index 167e0ee..e3848e0 100644
--- a/lib/ts/ink_sock.cc
+++ b/lib/ts/ink_sock.cc
@@ -233,7 +233,6 @@ fd_read_line(int fd, char *s, int len)
 {
   char c;
   int numread = 0, r;
-  // char *buf = s;
   do {
     do {
       r = read(fd, &c, 1);
diff --git a/proxy/hdrs/MIME.h b/proxy/hdrs/MIME.h
index 7ebc3bb..fbdf4c8 100644
--- a/proxy/hdrs/MIME.h
+++ b/proxy/hdrs/MIME.h
@@ -278,11 +278,9 @@ struct MIMEHdrImpl : public HdrHeapObjImpl {
  ***********************************************************************/
 
 struct MIMEScanner {
-  char *m_line; // buffered line being built up
-  // int m_type;               // what kind of scanner: raw line, or field (this has never been used)
+  char *m_line;           // buffered line being built up
   int m_line_length;      // size of real live data in buffer
   int m_line_size;        // total allocated size of buffer
-                          //  int m_state;                  // state of scanning state machine
   MimeParseState m_state; ///< Parsing machine state.
 };
 
diff --git a/proxy/http/HttpBodyFactory.cc b/proxy/http/HttpBodyFactory.cc
index 97d093d..5b73337 100644
--- a/proxy/http/HttpBodyFactory.cc
+++ b/proxy/http/HttpBodyFactory.cc
@@ -260,7 +260,6 @@ config_callback(const char * /* name ATS_UNUSED */, RecDataT /* data_type ATS_UN
 
 void
 HttpBodyFactory::reconfigure()
-//#endif
 {
   RecInt e;
   bool all_found;
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 308fb46..b3f645f 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -965,10 +965,6 @@ HttpSM::state_read_push_response_header(int event, void *data)
   int64_t data_size  = 0;
   int64_t bytes_used = 0;
 
-  // Not used here.
-  // bool parse_error = false;
-  // VIO* vio = (VIO*) data;
-
   switch (event) {
   case VC_EVENT_EOS:
     ua_entry->eos = true;
diff --git a/proxy/http/HttpTransact.h b/proxy/http/HttpTransact.h
index 3ad3211..f9ccd38 100644
--- a/proxy/http/HttpTransact.h
+++ b/proxy/http/HttpTransact.h
@@ -41,8 +41,6 @@
 #include "records/I_RecHttp.h"
 #include "ProxyClientSession.h"
 
-#define MAX_DNS_LOOKUPS 2
-
 #define HTTP_RELEASE_ASSERT(X) ink_release_assert(X)
 
 #define ACQUIRE_PRINT_LOCK() // ink_mutex_acquire(&print_lock);
@@ -456,11 +454,6 @@ public:
     VARIABILITY_ALL,
   };
 
-  struct StatRecord_t {
-    uint16_t index;
-    int64_t increment;
-  };
-
   enum CacheLookupResult_t {
     CACHE_LOOKUP_NONE,
     CACHE_LOOKUP_MISS,
@@ -684,8 +677,6 @@ public:
     _SquidLogInfo() {}
   } SquidLogInfo;
 
-#define HTTP_TRANSACT_STATE_MAX_XBUF_SIZE (1024 * 2) /* max size of plugin exchange buffer */
-
   struct State {
     HttpTransactMagic_t m_magic = HTTP_TRANSACT_MAGIC_ALIVE;
 
@@ -705,7 +696,6 @@ public:
     ConnectionAttributes client_info;
     ConnectionAttributes parent_info;
     ConnectionAttributes server_info;
-    // ConnectionAttributes     router_info;
 
     Source_t source                = SOURCE_NONE;
     Source_t pre_transform_source  = SOURCE_NONE;
@@ -731,7 +721,6 @@ public:
     ParentResult parent_result;
     CacheControlResult cache_control;
     CacheLookupResult_t cache_lookup_result = CACHE_LOOKUP_NONE;
-    // FilterResult             content_control;
 
     StateMachineAction_t next_action                      = SM_ACTION_UNDEFINED; // out
     StateMachineAction_t api_next_action                  = SM_ACTION_UNDEFINED; // out
diff --git a/src/traffic_server/CoreUtils.cc b/src/traffic_server/CoreUtils.cc
index 0d9853f..bdcb853 100644
--- a/src/traffic_server/CoreUtils.cc
+++ b/src/traffic_server/CoreUtils.cc
@@ -896,22 +896,18 @@ process_core(char *fname)
                 }
                 printf("\n");
 
-                // if (is_debug_tag_set("note")) {
                 printf("\n**** NT_PRSTATUS ****\n");
 
                 printf("Process id = %d\n", pstat.pr_pid);
                 printf("Parent Process id = %d\n", pstat.pr_ppid);
 
                 printf("Signal that caused this core dump is signal  = %d\n", pstat.pr_cursig);
-                // convert it using strsignal
-                // char *msg=strsignal(pstat.pr_cursig);
 
                 printf("stack pointer = %#x\n", (unsigned int)pstat.pr_reg[SP_REGNUM]); // UESP
                 framep = pstat.pr_reg[FP_REGNUM];
                 pc     = pstat.pr_reg[PC_REGNUM];
                 printf("frame pointer = %#x\n", (unsigned int)pstat.pr_reg[FP_REGNUM]); // EBP
                 printf("program counter if no save = %#x\n", (unsigned int)pstat.pr_reg[PC_REGNUM]);
-                //}
                 break;
 
               case NT_PRPSINFO:
diff --git a/src/traffic_server/SocksProxy.cc b/src/traffic_server/SocksProxy.cc
index bee32c2..1db846b 100644
--- a/src/traffic_server/SocksProxy.cc
+++ b/src/traffic_server/SocksProxy.cc
@@ -58,10 +58,8 @@ struct SocksProxy : public Continuation {
 
   ~SocksProxy() override {}
 
-  // int startEvent(int event, void * data);
   int mainEvent(int event, void *data);
   int setupHttpRequest(unsigned char *p);
-  // int setupServerTunnel(unsigned char * p);
 
   int sendResp(bool granted);
 
@@ -120,7 +118,6 @@ SocksProxy::mainEvent(int event, void *data)
 
   VIO *vio;
   int64_t n_read_avail;
-  // int n_consume;
 
   recursion++;
 
@@ -198,7 +195,6 @@ SocksProxy::mainEvent(int event, void *data)
             port_ptr                  = &p[2];
             clientVC->socks_addr.type = SOCKS_ATYPE_IPV4;
             reader->consume(i + 1);
-            // n_consume = i+1;
             ret = EVENT_DONE;
           }
         }
@@ -522,7 +518,6 @@ int
 socks5ServerAuthHandler(int event, unsigned char *p, void (**h_ptr)(void))
 {
   int ret = 0;
-  // bool no_auth_needed=true;
 
   switch (event) {
   case SOCKS_AUTH_READ_COMPLETE:
diff --git a/src/traffic_server/traffic_server.cc b/src/traffic_server/traffic_server.cc
index 164c19d..0e78668 100644
--- a/src/traffic_server/traffic_server.cc
+++ b/src/traffic_server/traffic_server.cc
@@ -791,9 +791,8 @@ cmd_clear(char *cmd)
 {
   Note("CLEAR");
 
-  bool c_all = !strcmp(cmd, "clear");
-  bool c_hdb = !strcmp(cmd, "clear_hostdb");
-  // bool c_adb = !strcmp(cmd, "clear_authdb");
+  bool c_all   = !strcmp(cmd, "clear");
+  bool c_hdb   = !strcmp(cmd, "clear_hostdb");
   bool c_cache = !strcmp(cmd, "clear_cache");
 
   if (c_all || c_hdb) {
@@ -818,16 +817,6 @@ cmd_clear(char *cmd)
     }
   }
 
-  //#ifndef INK_NO_ACC
-  //  if (c_adb || c_all) {
-  //   if (!acc.clear_cache()) {
-  //    return CMD_FAILED;
-  //  }
-  // if (c_adb)
-  //  return CMD_OK;
-  //  }
-  //#endif
-
   if (c_all || c_cache) {
     Note("Clearing Cache");
 
diff --git a/src/traffic_top/traffic_top.cc b/src/traffic_top/traffic_top.cc
index 47667ba..da44ae8 100644
--- a/src/traffic_top/traffic_top.cc
+++ b/src/traffic_top/traffic_top.cc
@@ -152,8 +152,6 @@ size_t
 write_data(void *ptr, size_t size, size_t nmemb, void * /* stream */)
 {
   response.append((char *)ptr, size * nmemb);
-  // cout << "appending: " << size * nmemb << endl;
-  // int written = fwrite(ptr, size, nmemb, (FILE *)stream);
   return size * nmemb;
 }