SolidWallOfCode commented on a change in pull request #7023:
URL: https://github.com/apache/trafficserver/pull/7023#discussion_r500326325
##########
File path: src/traffic_server/InkAPI.cc
##########
@@ -9790,6 +9791,54 @@ TSHttpTxnRedoCacheLookup(TSHttpTxn txnp, const char
*url, int length)
return TS_ERROR;
}
+TSReturnCode
+TSHostnameIsSelf(const char *hostname)
+{
+ const bool isSelf = Machine::instance()->is_self(hostname);
+ if (isSelf) {
+ return TS_SUCCESS;
+ }
+ return TS_ERROR;
+}
+
+TSReturnCode
+TSHostStatusGet(const char *hostname, TSHostStatus *status, unsigned int
*reason)
Review comment:
As a general rule, I prefer the C API functions to take strings as
`const char *, int` which is commonly done in (for instance) the MIME header
functions. This makes working with `string_view` (or `TextView`) in plugins
much easier. Internally `HostStatus::getHostStatus` should take an
`string_view` parameter so that it can be directly passed from this API call.
----------------------------------------------------------------
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]