You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2015/12/08 17:05:29 UTC

trafficserver git commit: TS-4052: Remove use of deprecated std::auto_ptr. This close #365.

Repository: trafficserver
Updated Branches:
  refs/heads/master 9087a4fa3 -> 255ea6836


TS-4052: Remove use of deprecated std::auto_ptr.
This close #365.


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

Branch: refs/heads/master
Commit: 255ea6836e5b0b10fae16ca180cb569b57ed036b
Parents: 9087a4f
Author: Alan M. Carroll <am...@apache.org>
Authored: Sat Dec 5 09:17:54 2015 -0600
Committer: Alan M. Carroll <am...@apache.org>
Committed: Tue Dec 8 10:04:50 2015 -0600

----------------------------------------------------------------------
 lib/atscppapi/src/include/atscppapi/shared_ptr.h | 2 ++
 plugins/experimental/multiplexer/Makefile.am     | 2 +-
 plugins/experimental/multiplexer/dispatch.cc     | 4 ++--
 plugins/experimental/multiplexer/dispatch.h      | 3 ++-
 4 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/255ea683/lib/atscppapi/src/include/atscppapi/shared_ptr.h
----------------------------------------------------------------------
diff --git a/lib/atscppapi/src/include/atscppapi/shared_ptr.h b/lib/atscppapi/src/include/atscppapi/shared_ptr.h
index 9d17a87..94b13e1 100644
--- a/lib/atscppapi/src/include/atscppapi/shared_ptr.h
+++ b/lib/atscppapi/src/include/atscppapi/shared_ptr.h
@@ -42,8 +42,10 @@ namespace atscppapi
  */
 #if HAVE_STD_SHARED_PTR
 using std::shared_ptr;
+using std::unique_ptr;
 #else
 using std::tr1::shared_ptr;
+using std::tr1::unique_ptr;
 #endif
 
 } /* atscppapi */

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/255ea683/plugins/experimental/multiplexer/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/experimental/multiplexer/Makefile.am b/plugins/experimental/multiplexer/Makefile.am
index e93d45c..72f527e 100644
--- a/plugins/experimental/multiplexer/Makefile.am
+++ b/plugins/experimental/multiplexer/Makefile.am
@@ -16,7 +16,7 @@
 
 include $(top_srcdir)/build/plugins.mk
 
-AM_CPPFLAGS += -DPLUGIN_TAG=\"multiplexer\"
+AM_CPPFLAGS += -DPLUGIN_TAG=\"multiplexer\" -I $(top_srcdir)/lib/atscppapi/src/include
 
 pkglib_LTLIBRARIES = multiplexer.la
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/255ea683/plugins/experimental/multiplexer/dispatch.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/multiplexer/dispatch.cc b/plugins/experimental/multiplexer/dispatch.cc
index a57256c..2ef49d0 100644
--- a/plugins/experimental/multiplexer/dispatch.cc
+++ b/plugins/experimental/multiplexer/dispatch.cc
@@ -47,7 +47,7 @@ Request::Request(const std::string &h, const TSMBuffer b, const TSMLoc l)
   assert(length == TSIOBufferReaderAvail(io->reader));
 }
 
-Request::Request(const Request &r) : host(r.host), length(r.length), io(const_cast<Request &>(r).io)
+Request::Request(const Request &r) : host(r.host), length(r.length), io(const_cast<Request &>(r).io.release())
 {
   assert(!host.empty());
   assert(length > 0);
@@ -59,7 +59,7 @@ Request &Request::operator=(const Request &r)
 {
   host = r.host;
   length = r.length;
-  io = const_cast<Request &>(r).io;
+  io.reset(const_cast<Request &>(r).io.release());
   assert(!host.empty());
   assert(length > 0);
   assert(io.get() != NULL);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/255ea683/plugins/experimental/multiplexer/dispatch.h
----------------------------------------------------------------------
diff --git a/plugins/experimental/multiplexer/dispatch.h b/plugins/experimental/multiplexer/dispatch.h
index 03173a8..5b21d05 100644
--- a/plugins/experimental/multiplexer/dispatch.h
+++ b/plugins/experimental/multiplexer/dispatch.h
@@ -28,6 +28,7 @@
 #include <string>
 #include <ts/ts.h>
 #include <vector>
+#include <atscppapi/shared_ptr.h>
 
 #include "ts.h"
 
@@ -51,7 +52,7 @@ typedef std::vector<std::string> Origins;
 struct Request {
   std::string host;
   int length;
-  std::auto_ptr<ats::io::IO> io;
+  atscppapi::unique_ptr<ats::io::IO> io;
 
   Request(const std::string &, const TSMBuffer, const TSMLoc);
   Request(const Request &);