aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/security/transport
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2017-11-20 10:50:38 -0500
committerGravatar ncteisen <ncteisen@gmail.com>2017-11-20 10:56:04 -0500
commit993e9f06921123a9220031398ecfbf52a6114dce (patch)
treef15a85d3446e8a8495e8fb5b02a1f7c4aa26c6fc /src/core/lib/security/transport
parent46f9175ba3a27958a1655707d6014de1ba3ce4d5 (diff)
parent9addd2eef21a96e52135dc9369566d8452412763 (diff)
Merge branch 'master' of https://github.com/grpc/grpc into no-more-extern-c
Diffstat (limited to 'src/core/lib/security/transport')
-rw-r--r--src/core/lib/security/transport/secure_endpoint.cc11
-rw-r--r--src/core/lib/security/transport/secure_endpoint.h2
-rw-r--r--src/core/lib/security/transport/security_connector.cc10
-rw-r--r--src/core/lib/security/transport/security_connector.h4
4 files changed, 11 insertions, 16 deletions
diff --git a/src/core/lib/security/transport/secure_endpoint.cc b/src/core/lib/security/transport/secure_endpoint.cc
index 3ba987a105..4cd317a06d 100644
--- a/src/core/lib/security/transport/secure_endpoint.cc
+++ b/src/core/lib/security/transport/secure_endpoint.cc
@@ -61,8 +61,7 @@ typedef struct {
gpr_refcount ref;
} secure_endpoint;
-grpc_tracer_flag grpc_trace_secure_endpoint =
- GRPC_TRACER_INITIALIZER(false, "secure_endpoint");
+grpc_core::TraceFlag grpc_trace_secure_endpoint(false, "secure_endpoint");
static void destroy(grpc_exec_ctx* exec_ctx, secure_endpoint* secure_ep) {
secure_endpoint* ep = secure_ep;
@@ -86,7 +85,7 @@ static void destroy(grpc_exec_ctx* exec_ctx, secure_endpoint* secure_ep) {
static void secure_endpoint_unref(grpc_exec_ctx* exec_ctx, secure_endpoint* ep,
const char* reason, const char* file,
int line) {
- if (GRPC_TRACER_ON(grpc_trace_secure_endpoint)) {
+ if (grpc_trace_secure_endpoint.enabled()) {
gpr_atm val = gpr_atm_no_barrier_load(&ep->ref.count);
gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
"SECENDP unref %p : %s %" PRIdPTR " -> %" PRIdPTR, ep, reason, val,
@@ -99,7 +98,7 @@ static void secure_endpoint_unref(grpc_exec_ctx* exec_ctx, secure_endpoint* ep,
static void secure_endpoint_ref(secure_endpoint* ep, const char* reason,
const char* file, int line) {
- if (GRPC_TRACER_ON(grpc_trace_secure_endpoint)) {
+ if (grpc_trace_secure_endpoint.enabled()) {
gpr_atm val = gpr_atm_no_barrier_load(&ep->ref.count);
gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
"SECENDP ref %p : %s %" PRIdPTR " -> %" PRIdPTR, ep, reason, val,
@@ -131,7 +130,7 @@ static void flush_read_staging_buffer(secure_endpoint* ep, uint8_t** cur,
static void call_read_cb(grpc_exec_ctx* exec_ctx, secure_endpoint* ep,
grpc_error* error) {
- if (GRPC_TRACER_ON(grpc_trace_secure_endpoint)) {
+ if (grpc_trace_secure_endpoint.enabled()) {
size_t i;
for (i = 0; i < ep->read_buffer->count; i++) {
char* data = grpc_dump_slice(ep->read_buffer->slices[i],
@@ -271,7 +270,7 @@ static void endpoint_write(grpc_exec_ctx* exec_ctx, grpc_endpoint* secure_ep,
grpc_slice_buffer_reset_and_unref_internal(exec_ctx, &ep->output_buffer);
- if (GRPC_TRACER_ON(grpc_trace_secure_endpoint)) {
+ if (grpc_trace_secure_endpoint.enabled()) {
for (i = 0; i < slices->count; i++) {
char* data =
grpc_dump_slice(slices->slices[i], GPR_DUMP_HEX | GPR_DUMP_ASCII);
diff --git a/src/core/lib/security/transport/secure_endpoint.h b/src/core/lib/security/transport/secure_endpoint.h
index aff6b22050..b2556a0182 100644
--- a/src/core/lib/security/transport/secure_endpoint.h
+++ b/src/core/lib/security/transport/secure_endpoint.h
@@ -25,7 +25,7 @@
struct tsi_frame_protector;
struct tsi_zero_copy_grpc_protector;
-extern grpc_tracer_flag grpc_trace_secure_endpoint;
+extern grpc_core::TraceFlag grpc_trace_secure_endpoint;
/* Takes ownership of protector, zero_copy_protector, and to_wrap, and refs
* leftover_slices. If zero_copy_protector is not NULL, protector will never be
diff --git a/src/core/lib/security/transport/security_connector.cc b/src/core/lib/security/transport/security_connector.cc
index b996cc8cdb..c56e459aeb 100644
--- a/src/core/lib/security/transport/security_connector.cc
+++ b/src/core/lib/security/transport/security_connector.cc
@@ -44,10 +44,8 @@
#include "src/core/tsi/ssl_transport_security.h"
#include "src/core/tsi/transport_security_adapter.h"
-#ifndef NDEBUG
-grpc_tracer_flag grpc_trace_security_connector_refcount =
- GRPC_TRACER_INITIALIZER(false, "security_connector_refcount");
-#endif
+grpc_core::DebugOnlyTraceFlag grpc_trace_security_connector_refcount(
+ false, "security_connector_refcount");
/* -- Constants. -- */
@@ -198,7 +196,7 @@ grpc_security_connector* grpc_security_connector_ref(
grpc_security_connector* sc, const char* file, int line,
const char* reason) {
if (sc == nullptr) return nullptr;
- if (GRPC_TRACER_ON(grpc_trace_security_connector_refcount)) {
+ if (grpc_trace_security_connector_refcount.enabled()) {
gpr_atm val = gpr_atm_no_barrier_load(&sc->refcount.count);
gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
"SECURITY_CONNECTOR:%p ref %" PRIdPTR " -> %" PRIdPTR " %s", sc,
@@ -219,7 +217,7 @@ void grpc_security_connector_unref(grpc_exec_ctx* exec_ctx,
const char* file, int line,
const char* reason) {
if (sc == nullptr) return;
- if (GRPC_TRACER_ON(grpc_trace_security_connector_refcount)) {
+ if (grpc_trace_security_connector_refcount.enabled()) {
gpr_atm val = gpr_atm_no_barrier_load(&sc->refcount.count);
gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
"SECURITY_CONNECTOR:%p unref %" PRIdPTR " -> %" PRIdPTR " %s", sc,
diff --git a/src/core/lib/security/transport/security_connector.h b/src/core/lib/security/transport/security_connector.h
index 15c0430010..03daba3a18 100644
--- a/src/core/lib/security/transport/security_connector.h
+++ b/src/core/lib/security/transport/security_connector.h
@@ -29,9 +29,7 @@
#include "src/core/tsi/ssl_transport_security.h"
#include "src/core/tsi/transport_security_interface.h"
-#ifndef NDEBUG
-extern grpc_tracer_flag grpc_trace_security_connector_refcount;
-#endif
+extern grpc_core::DebugOnlyTraceFlag grpc_trace_security_connector_refcount;
/* --- status enum. --- */