You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2021/04/01 15:50:56 UTC
[GitHub] [trafficserver] shinrich commented on a change in pull request #7667: Add class to normalize handling of pending action
shinrich commented on a change in pull request #7667:
URL: https://github.com/apache/trafficserver/pull/7667#discussion_r605765336
##########
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:
Good point. The pending_action is explicitly assigned to nullptr in the HttpSM::kill_this(). But you are correct. In the current code, the destructor is not called.
--
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:
users@infra.apache.org