SolidWallOfCode commented on a change in pull request #7667:
URL: https://github.com/apache/trafficserver/pull/7667#discussion_r605994660
##########
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:
No - if this is ever used more normally (e.g. we stop using free lists)
then the lack of a destructor will cause some nasty problems. We need to move
toward more standard C++, not away from it.
--
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]