aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/memory_usage/server.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/memory_usage/server.c')
-rw-r--r--test/core/memory_usage/server.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/test/core/memory_usage/server.c b/test/core/memory_usage/server.c
index c0710930b0..e8774bd976 100644
--- a/test/core/memory_usage/server.c
+++ b/test/core/memory_usage/server.c
@@ -110,7 +110,8 @@ static void send_status(void *tag) {
status_op.op = GRPC_OP_SEND_STATUS_FROM_SERVER;
status_op.data.send_status_from_server.status = GRPC_STATUS_OK;
status_op.data.send_status_from_server.trailing_metadata_count = 0;
- status_op.data.send_status_from_server.status_details = "";
+ grpc_slice details = grpc_slice_from_static_string("");
+ status_op.data.send_status_from_server.status_details = &details;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch((*(fling_call *)tag).call,
&status_op, 1, tag, NULL));
@@ -140,7 +141,8 @@ static void send_snapshot(void *tag, struct grpc_memory_counters *snapshot) {
op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
op->data.send_status_from_server.status = GRPC_STATUS_OK;
op->data.send_status_from_server.trailing_metadata_count = 0;
- op->data.send_status_from_server.status_details = "";
+ grpc_slice details = grpc_slice_from_static_string("");
+ op->data.send_status_from_server.status_details = &details;
op++;
op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
op->data.recv_close_on_server.cancelled = &was_cancelled;
@@ -245,25 +247,27 @@ int main(int argc, char **argv) {
switch (s->state) {
case FLING_SERVER_NEW_REQUEST:
request_call_unary(++next_call_idx);
- if (0 ==
- strcmp(s->call_details.method, "/Reflector/reflectUnary")) {
+ if (0 == grpc_slice_str_cmp(s->call_details.method,
+ "/Reflector/reflectUnary")) {
s->state = FLING_SERVER_SEND_INIT_METADATA;
send_initial_metadata_unary(s);
- } else if (0 == strcmp(s->call_details.method,
- "Reflector/GetBeforeSvrCreation")) {
+ } else if (0 ==
+ grpc_slice_str_cmp(s->call_details.method,
+ "Reflector/GetBeforeSvrCreation")) {
s->state = FLING_SERVER_SEND_STATUS_SNAPSHOT;
send_snapshot(s, &before_server_create);
- } else if (0 == strcmp(s->call_details.method,
- "Reflector/GetAfterSvrCreation")) {
+ } else if (0 ==
+ grpc_slice_str_cmp(s->call_details.method,
+ "Reflector/GetAfterSvrCreation")) {
s->state = FLING_SERVER_SEND_STATUS_SNAPSHOT;
send_snapshot(s, &after_server_create);
- } else if (0 == strcmp(s->call_details.method,
- "Reflector/SimpleSnapshot")) {
+ } else if (0 == grpc_slice_str_cmp(s->call_details.method,
+ "Reflector/SimpleSnapshot")) {
s->state = FLING_SERVER_SEND_STATUS_SNAPSHOT;
current_snapshot = grpc_memory_counters_snapshot();
send_snapshot(s, &current_snapshot);
- } else if (0 == strcmp(s->call_details.method,
- "Reflector/DestroyCalls")) {
+ } else if (0 == grpc_slice_str_cmp(s->call_details.method,
+ "Reflector/DestroyCalls")) {
s->state = FLING_SERVER_BATCH_SEND_STATUS_FLING_CALL;
current_snapshot = grpc_memory_counters_snapshot();
send_snapshot(s, &current_snapshot);