maskit commented on a change in pull request #7667:
URL: https://github.com/apache/trafficserver/pull/7667#discussion_r605294935



##########
File path: proxy/http/HttpSM.h
##########
@@ -166,6 +166,52 @@ enum HttpPluginTunnel_t {
 
 class PluginVCCore;
 
+class PendingAction
+{
+public:
+  bool
+  operator==(Action *b)
+  {
+    return b == pending_action;
+  }
+  bool
+  operator!=(Action *b)
+  {
+    return b != pending_action;
+  }
+  PendingAction &
+  operator=(Action *b)
+  {
+    // Don't do anything if the new action is _DONE
+    if (b != ACTION_RESULT_DONE) {
+      if (b != pending_action && pending_action != nullptr) {
+        pending_action->cancel();
+      }
+      pending_action = b;
+    }
+    return *this;
+  }
+  Action *
+  operator->()
+  {
+    return pending_action;
+  }
+  Action *
+  get()
+  {
+    return pending_action;
+  }
+  ~PendingAction()

Review comment:
       Is this destructor really called? It'd be called if HttpSM's destructor 
was called, but I don't think HttpSM's destructor is called because the 
allocator declaration don't have `true` to call the destructor automatically 
and I don't see any places that calls the destructor manually.
   ```
   ClassAllocator<HttpSM> httpSMAllocator("httpSMAllocator");
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to