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/06/09 16:35:51 UTC

[6/7] trafficserver git commit: TS-3634 Replace auto_ptr with ats_scoped_object

TS-3634 Replace auto_ptr with ats_scoped_object


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

Branch: refs/heads/master
Commit: 8904069e29ddb421848fee2a84963c1b823f3013
Parents: 5f20494
Author: Leif Hedstrom <zw...@apache.org>
Authored: Fri May 22 14:18:19 2015 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Tue Jun 9 08:19:27 2015 -0600

----------------------------------------------------------------------
 iocore/net/SSLSessionCache.cc                 | 3 +--
 plugins/cacheurl/cacheurl.cc                  | 4 ++--
 plugins/experimental/sslheaders/sslheaders.cc | 6 +++---
 3 files changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8904069e/iocore/net/SSLSessionCache.cc
----------------------------------------------------------------------
diff --git a/iocore/net/SSLSessionCache.cc b/iocore/net/SSLSessionCache.cc
index 740b14f..67513a1 100644
--- a/iocore/net/SSLSessionCache.cc
+++ b/iocore/net/SSLSessionCache.cc
@@ -22,7 +22,6 @@
 #include "P_SSLConfig.h"
 #include "SSLSessionCache.h"
 #include <cstring>
-#include <memory>
 
 #define SSLSESSIONCACHE_STRINGIFY0(x) #x
 #define SSLSESSIONCACHE_STRINGIFY(x) SSLSESSIONCACHE_STRINGIFY0(x)
@@ -132,7 +131,7 @@ SSLSessionBucket::insertSession(const SSLSessionID &id, SSL_SESSION *sess)
   unsigned char *loc = reinterpret_cast<unsigned char *>(buf->data());
   i2d_SSL_SESSION(sess, &loc);
 
-  std::auto_ptr<SSLSession> ssl_session(new SSLSession(id, buf, len));
+  ats_scoped_obj<SSLSession> ssl_session(new SSLSession(id, buf, len));
 
   MUTEX_TRY_LOCK(lock, mutex, this_ethread());
   if (!lock.is_locked()) {

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8904069e/plugins/cacheurl/cacheurl.cc
----------------------------------------------------------------------
diff --git a/plugins/cacheurl/cacheurl.cc b/plugins/cacheurl/cacheurl.cc
index 52565fc..d17c732 100644
--- a/plugins/cacheurl/cacheurl.cc
+++ b/plugins/cacheurl/cacheurl.cc
@@ -28,8 +28,8 @@
 #include "ts/ts.h"
 #include "ts/remap.h"
 #include "ink_defs.h"
+#include "ink_memory.h"
 
-#include <memory>
 #include <string>
 #include <vector>
 
@@ -205,7 +205,7 @@ load_config_file(const char *config_file)
   char buffer[1024];
   std::string path;
   TSFile fh;
-  std::auto_ptr<pr_list> prl(new pr_list());
+  ats_scoped_obj<pr_list> prl(new pr_list());
 
   /* locations in a config file line, end of line, split start, split end */
   char *eol, *spstart, *spend;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8904069e/plugins/experimental/sslheaders/sslheaders.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/sslheaders/sslheaders.cc b/plugins/experimental/sslheaders/sslheaders.cc
index 5d77911..ce5ba9e 100644
--- a/plugins/experimental/sslheaders/sslheaders.cc
+++ b/plugins/experimental/sslheaders/sslheaders.cc
@@ -17,12 +17,12 @@
  */
 
 #include "sslheaders.h"
+#include "ink_memory.h"
+
 #include <getopt.h>
 #include <openssl/ssl.h>
 #include <openssl/x509.h>
 
-#include <memory>
-
 static void SslHdrExpand(SSL *, const SslHdrInstance::expansion_list &, TSMBuffer, TSMLoc);
 
 static int
@@ -168,7 +168,7 @@ SslHdrParseOptions(int argc, const char **argv)
 {
   static const struct option longopt[] = {{const_cast<char *>("attach"), required_argument, 0, 'a'}, {0, 0, 0, 0}};
 
-  std::auto_ptr<SslHdrInstance> hdr(new SslHdrInstance());
+  ats_scoped_obj<SslHdrInstance> hdr(new SslHdrInstance());
 
   // We might parse arguments multiple times if we are loaded as a global
   // plugin and a remap plugin. Reset optind so that getopt_long() does the