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 2019/06/15 16:22:42 UTC

[trafficserver] 12/23: Step 12: Removes extractVersionInfo()

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

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

commit a28aee0bcb29d32facf2c0b045dee72a83e338b7
Author: Leif Hedstrom <zw...@apache.org>
AuthorDate: Fri May 24 16:50:43 2019 -0600

    Step 12: Removes extractVersionInfo()
---
 mgmt/Rollback.cc | 54 ------------------------------------------------------
 mgmt/Rollback.h  |  1 -
 2 files changed, 55 deletions(-)

diff --git a/mgmt/Rollback.cc b/mgmt/Rollback.cc
index a669f55..6fa04f2 100644
--- a/mgmt/Rollback.cc
+++ b/mgmt/Rollback.cc
@@ -203,60 +203,6 @@ Rollback::closeFile(int fd, bool callSync)
   return result;
 }
 
-// version_t Rollback::extractVersionInfo(ExpandingArray* listNames,
-//                                        const char* testFileName)
-//
-//   Extracts the version number out of testFileName if it matches
-//     with the fileName_version format; adds the fileInfo to
-//     listNames if there is a match; returns INVALID_VERSION
-//     if there is no match.
-//
-version_t
-Rollback::extractVersionInfo(ExpandingArray *listNames, const char *testFileName)
-{
-  const char *str;
-  version_t version = INVALID_VERSION;
-
-  // Check to see if the current entry is a rollback file
-  //   fileFormat: fileName_version
-  //
-  // Check to see if the prefix of the current entry
-  //  is the same as our fileName
-  if (strlen(testFileName) > fileNameLen) {
-    if (strncmp(testFileName, fileName, fileNameLen) == 0) {
-      // Check for the underscore
-      if (*(testFileName + fileNameLen) == '_') {
-        // Check for the integer version number
-        const char *currentVersionStr = str = testFileName + fileNameLen + 1;
-
-        for (; isdigit(*str) && *str != '\0'; str++) {
-          ;
-        }
-
-        // Do not tolerate anything but numbers on the end
-        //   of the file
-        if (*str == '\0') {
-          version = atoi(currentVersionStr);
-
-          // Add info about version number and modTime
-          if (listNames != nullptr) {
-            struct stat fileInfo;
-
-            if (statFile(version, &fileInfo) >= 0) {
-              versionInfo *verInfo = (versionInfo *)ats_malloc(sizeof(versionInfo));
-              verInfo->version     = version;
-              verInfo->modTime     = fileInfo.st_mtime;
-              listNames->addEntry((void *)verInfo);
-            }
-          }
-        }
-      }
-    }
-  }
-
-  return version;
-}
-
 bool
 Rollback::setLastModifiedTime()
 {
diff --git a/mgmt/Rollback.h b/mgmt/Rollback.h
index 9f9a7e8..ae6d990 100644
--- a/mgmt/Rollback.h
+++ b/mgmt/Rollback.h
@@ -113,7 +113,6 @@ public:
   {
     ink_mutex_release(&fileAccessLock);
   };
-  version_t extractVersionInfo(ExpandingArray *listNames, const char *testFileName);
 
   // Automatically take out lock
   bool checkForUserUpdate();