trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [2/2] trafficserver git commit: [TS-4256] flagging aborts and avoiding consuming the reader This closes #511.
Date Sat, 19 Mar 2016 16:32:55 GMT
[TS-4256] flagging aborts and avoiding consuming the reader
This closes #511.


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

Branch: refs/heads/master
Commit: 1e9c9484cacbfaa4ded7ad2c7e7baad74cb0f4f6
Parents: 1448b4b
Author: Daniel Vitor Morilha <dmorilha@yahoo-inc.com>
Authored: Fri Mar 4 11:25:54 2016 -0800
Committer: Alan M. Carroll <amc@apache.org>
Committed: Sat Mar 19 11:32:30 2016 -0500

----------------------------------------------------------------------
 plugins/experimental/inliner/inliner-handler.cc | 3 ++-
 plugins/experimental/inliner/inliner-handler.h  | 9 ++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1e9c9484/plugins/experimental/inliner/inliner-handler.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/inliner/inliner-handler.cc b/plugins/experimental/inliner/inliner-handler.cc
index d075661..09cf3cf 100644
--- a/plugins/experimental/inliner/inliner-handler.cc
+++ b/plugins/experimental/inliner/inliner-handler.cc
@@ -33,7 +33,7 @@ namespace ats
 namespace inliner
 {
   Handler::Handler(const TSIOBufferReader r, ats::io::IOSinkPointer &&i)
-    : ioSink_(i), sink_(ioSink_->branch()), sink2_(sink_->branch()), reader_(TSIOBufferReaderClone(r)),
counter_(0)
+    : ioSink_(i), sink_(ioSink_->branch()), sink2_(sink_->branch()), reader_(TSIOBufferReaderClone(r)),
counter_(0), abort_(false)
   {
     assert(ioSink_);
     assert(sink_);
@@ -141,6 +141,7 @@ namespace inliner
   void
   Handler::abort(void)
   {
+    abort_ = true;
     assert(ioSink_);
     ioSink_->abort();
   }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1e9c9484/plugins/experimental/inliner/inliner-handler.h
----------------------------------------------------------------------
diff --git a/plugins/experimental/inliner/inliner-handler.h b/plugins/experimental/inliner/inliner-handler.h
index d7caba1..692a5e8 100644
--- a/plugins/experimental/inliner/inliner-handler.h
+++ b/plugins/experimental/inliner/inliner-handler.h
@@ -38,13 +38,16 @@ namespace inliner
     ats::io::SinkPointer sink_, sink2_;
     const TSIOBufferReader reader_;
     size_t counter_;
+    bool abort_;
 
     ~Handler()
     {
       assert(reader_ != NULL);
-      const int64_t available = TSIOBufferReaderAvail(reader_);
-      if (available > 0) {
-        TSIOBufferReaderConsume(reader_, available);
+      if (!abort_) {
+        const int64_t available = TSIOBufferReaderAvail(reader_);
+        if (available > 0) {
+          TSIOBufferReaderConsume(reader_, available);
+        }
       }
       TSIOBufferReaderFree(reader_);
     }


Mime
View raw message