diff options
author | Craig Tiller <ctiller@google.com> | 2017-01-27 14:08:01 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-01-27 14:08:01 -0800 |
commit | dcacce65a070a3a0c99e92c605f37b500b6f33f3 (patch) | |
tree | f00fde694ff9a6094b8f02d39e11d49351b8941c /src/core/lib/surface/call_log_batch.c | |
parent | cf2ceaae2913dcc74feb042a32aea6d47cffa795 (diff) | |
parent | efbd7c2a0f82af841ad79998645e3729dee9676d (diff) |
Merge branch 'bm_countwrites+bwest' into bwest
Diffstat (limited to 'src/core/lib/surface/call_log_batch.c')
-rw-r--r-- | src/core/lib/surface/call_log_batch.c | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/src/core/lib/surface/call_log_batch.c b/src/core/lib/surface/call_log_batch.c index 7fc58e19c2..61b73a138f 100644 --- a/src/core/lib/surface/call_log_batch.c +++ b/src/core/lib/surface/call_log_batch.c @@ -35,22 +35,17 @@ #include <grpc/support/alloc.h> #include <grpc/support/string_util.h> -#include "src/core/lib/slice/slice_string_helpers.h" #include "src/core/lib/support/string.h" static void add_metadata(gpr_strvec *b, const grpc_metadata *md, size_t count) { size_t i; - if (md == NULL) { - gpr_strvec_add(b, gpr_strdup("(nil)")); - return; - } for (i = 0; i < count; i++) { gpr_strvec_add(b, gpr_strdup("\nkey=")); - gpr_strvec_add(b, grpc_slice_to_c_string(md[i].key)); + gpr_strvec_add(b, gpr_strdup(md[i].key)); gpr_strvec_add(b, gpr_strdup(" value=")); - gpr_strvec_add(b, - grpc_dump_slice(md[i].value, GPR_DUMP_HEX | GPR_DUMP_ASCII)); + gpr_strvec_add(b, gpr_dump(md[i].value, md[i].value_length, + GPR_DUMP_HEX | GPR_DUMP_ASCII)); } } @@ -68,33 +63,29 @@ char *grpc_op_string(const grpc_op *op) { op->data.send_initial_metadata.count); break; case GRPC_OP_SEND_MESSAGE: - gpr_asprintf(&tmp, "SEND_MESSAGE ptr=%p", op->data.send_message); + gpr_asprintf(&tmp, "SEND_MESSAGE ptr=%p", + op->data.send_message.send_message); gpr_strvec_add(&b, tmp); break; case GRPC_OP_SEND_CLOSE_FROM_CLIENT: gpr_strvec_add(&b, gpr_strdup("SEND_CLOSE_FROM_CLIENT")); break; case GRPC_OP_SEND_STATUS_FROM_SERVER: - gpr_asprintf(&tmp, "SEND_STATUS_FROM_SERVER status=%d details=", - op->data.send_status_from_server.status); + gpr_asprintf(&tmp, "SEND_STATUS_FROM_SERVER status=%d details=%s", + op->data.send_status_from_server.status, + op->data.send_status_from_server.status_details); gpr_strvec_add(&b, tmp); - if (op->data.send_status_from_server.status_details != NULL) { - gpr_strvec_add(&b, grpc_dump_slice( - *op->data.send_status_from_server.status_details, - GPR_DUMP_ASCII)); - } else { - gpr_strvec_add(&b, gpr_strdup("(null)")); - } add_metadata(&b, op->data.send_status_from_server.trailing_metadata, op->data.send_status_from_server.trailing_metadata_count); break; case GRPC_OP_RECV_INITIAL_METADATA: gpr_asprintf(&tmp, "RECV_INITIAL_METADATA ptr=%p", - op->data.recv_initial_metadata); + op->data.recv_initial_metadata.recv_initial_metadata); gpr_strvec_add(&b, tmp); break; case GRPC_OP_RECV_MESSAGE: - gpr_asprintf(&tmp, "RECV_MESSAGE ptr=%p", op->data.recv_message); + gpr_asprintf(&tmp, "RECV_MESSAGE ptr=%p", + op->data.recv_message.recv_message); gpr_strvec_add(&b, tmp); break; case GRPC_OP_RECV_STATUS_ON_CLIENT: |