SolidWallOfCode commented on a change in pull request #7364:
URL: https://github.com/apache/trafficserver/pull/7364#discussion_r534284356
##########
File path: example/plugins/c-api/lifecycle_plugin/lifecycle_plugin.c
##########
@@ -49,6 +49,10 @@ CallbackHandler(TSCont this, TSEvent id, void *data)
case TS_EVENT_LIFECYCLE_MSG: {
TSPluginMsg *msg = (TSPluginMsg *)data;
TSDebug(PLUGIN_NAME, "Message to '%s' - %zu bytes of data", msg->tag,
msg->data_size);
+ if (msg->data_size == 0) {
Review comment:
Isn't this clear from the message on line 51?
##########
File path: plugins/experimental/memory_profile/memory_profile.cc
##########
@@ -49,26 +49,28 @@ CallbackHandler(TSCont cont, TSEvent id, void *data)
TSDebug(PLUGIN_NAME, "Message to '%s' - %zu bytes of data", msg->tag,
msg->data_size);
if (strcmp(PLUGIN_NAME, msg->tag) == 0) { // Message is for us
#if TS_HAS_JEMALLOC
- int retval = 0;
- if (strncmp((char *)msg->data, "dump", msg->data_size) == 0) {
- if ((retval = mallctl("prof.dump", nullptr, nullptr, nullptr, 0)) !=
0) {
- TSError("mallct(prof.dump) failed retval=%d errno=%d", retval,
errno);
+ if (msg->data_size) {
Review comment:
Is the size check needed here, or just in the debug message at line 72?
`strncmp` should handle a zero size.
----------------------------------------------------------------
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]