@@ -1095,6 +1095,7 @@ int ZmqAgent::send_command_message(const char* command,
1095
1095
return PrintZmqError (zmq::ZMQ_ERROR_SEND_COMMAND_NO_DATA_HANDLE, command);
1096
1096
}
1097
1097
1098
+ const char * real_body = body ? (strlen (body) ? body : " \"\" " ) : " null" ;
1098
1099
auto recorded = create_recorded (system_clock::now ());
1099
1100
int r;
1100
1101
if (request_id == nullptr ) {
@@ -1108,7 +1109,7 @@ int ZmqAgent::send_command_message(const char* command,
1108
1109
0 ,
1109
1110
metrics_period_,
1110
1111
version_,
1111
- body );
1112
+ real_body );
1112
1113
1113
1114
} else {
1114
1115
r = snprintf (msg_buf_,
@@ -1122,7 +1123,7 @@ int ZmqAgent::send_command_message(const char* command,
1122
1123
0 ,
1123
1124
metrics_period_,
1124
1125
version_,
1125
- body );
1126
+ real_body );
1126
1127
}
1127
1128
1128
1129
if (r < 0 ) {
@@ -1371,7 +1372,7 @@ int ZmqAgent::generate_snapshot(const json& message,
1371
1372
}
1372
1373
1373
1374
// send snapshot command reponse thru data channel
1374
- int r = send_command_message (" snapshot" , req_id.c_str (), " " );
1375
+ int r = send_command_message (" snapshot" , req_id.c_str (), nullptr );
1375
1376
if (r < 0 ) {
1376
1377
return r;
1377
1378
}
@@ -2208,7 +2209,7 @@ std::string ZmqAgent::got_cpu_profile(int status,
2208
2209
// send profile_stop command reponse thru data channel
2209
2210
// only if the profile is complete
2210
2211
if (profileStreamComplete) {
2211
- int r = send_command_message (" profile_stop" , req_id.c_str (), " " );
2212
+ int r = send_command_message (" profile_stop" , req_id.c_str (), nullptr );
2212
2213
if (r < 0 ) {
2213
2214
return req_id;
2214
2215
}
@@ -2292,7 +2293,7 @@ int ZmqAgent::start_profiling(const json& message,
2292
2293
}
2293
2294
2294
2295
// send profile command reponse thru data channel
2295
- err = send_command_message (kProfile , req_id.c_str (), " " );
2296
+ err = send_command_message (kProfile , req_id.c_str (), nullptr );
2296
2297
if (err < 0 ) {
2297
2298
return err;
2298
2299
}
0 commit comments