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/02/16 15:43:47 UTC
[GitHub] [trafficserver] SolidWallOfCode commented on a change in pull request #7467: Parent Select Plugin
SolidWallOfCode commented on a change in pull request #7467:
URL: https://github.com/apache/trafficserver/pull/7467#discussion_r576923199
##########
File path: include/ts/nexthop.h
##########
@@ -28,22 +28,28 @@
#pragma once
-#include <ts/apidefs.h>
-
-// plugin callback commands.
-enum NHCmd { NH_MARK_UP, NH_MARK_DOWN };
-
-struct NHHealthStatus {
- virtual bool isNextHopAvailable(TSHttpTxn txn, const char *hostname, const int port, void *ih = nullptr) = 0;
- virtual void markNextHop(TSHttpTxn txn, const char *hostname, const int port, const NHCmd status, void *ih = nullptr,
- const time_t now = 0) = 0;
- virtual ~NHHealthStatus() {}
-};
-
-struct NHPluginStrategy {
- virtual void findNextHop(TSHttpTxn txnp, void *ih = nullptr) = 0;
- virtual bool nextHopExists(TSHttpTxn txnp, void *ih = nullptr) = 0;
- virtual ~NHPluginStrategy() {}
-
- NHHealthStatus *healthStatus;
-};
+// Plugins may set this to indicate how to retry.
+//
+// If handled is false, then no plugin set it, and Core will proceed to do its own thing.
+//
+// If handled is true, core will not do any parent processing, markdown, or anything else,
+// but will use the values in this for whether to use the existing response or make another request,
+// and what that request should look like.
+//
+// See the API functions which take this for ownership requirements of pointers, like hostname.
+//
+// DO NOT put non-POD data in this. It's passed by-copy from API calls.
+//
+typedef struct {
+ // TODO this shouldn't be necessary - plugins should manipulate the response as they see fit,
+ // core shouldn't "know" if it was a "success" or "failure," only the response or retry data/action.
+ // But for now, core needs to know, for reasons.
+ bool fail;
+ const char *hostname;
Review comment:
Add `length` - don't require a C-string.
----------------------------------------------------------------
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