Addressing comments

pull/1312/head
Craig Tiller 10 years ago
parent 5c019ae2d1
commit 9c9d4e0cd9
  1. 2
      include/grpc/grpc.h
  2. 2
      src/core/channel/call_op_string.c
  3. 4
      src/core/channel/census_filter.c
  4. 3
      src/core/channel/http_server_filter.c
  5. 6
      src/core/security/auth.c

@ -191,7 +191,7 @@ typedef struct grpc_metadata {
There is no need to initialize them, and they will be set to garbage during
calls to grpc. */
struct {
void *some_random_pointers[3];
void *obfuscated[3];
} internal_data;
} grpc_metadata;

@ -55,7 +55,7 @@ static void put_metadata(gpr_strvec *b, grpc_mdelem *md) {
static void put_metadata_list(gpr_strvec *b, grpc_metadata_batch md) {
grpc_linked_mdelem *m;
for (m = md.list.head; m; m = m->next) {
for (m = md.list.head; m != NULL; m = m->next) {
put_metadata(b, m->md);
}
if (gpr_time_cmp(md.deadline, gpr_inf_future) != 0) {

@ -63,9 +63,9 @@ static void init_rpc_stats(census_rpc_stats* stats) {
static void extract_and_annotate_method_tag(grpc_call_op* op, call_data* calld,
channel_data* chand) {
grpc_linked_mdelem* m;
for (m = op->data.metadata.list.head; m; m = m->next) {
for (m = op->data.metadata.list.head; m != NULL; m = m->next) {
if (m->md->key == chand->path_str) {
gpr_log(GPR_DEBUG, (const char*)GPR_SLICE_START_PTR(m->md->value->slice));
gpr_log(GPR_DEBUG, "%s", (const char*)GPR_SLICE_START_PTR(m->md->value->slice));
census_add_method_tag(
calld->op_id, (const char*)GPR_SLICE_START_PTR(m->md->value->slice));
}

@ -101,8 +101,7 @@ static grpc_mdelem *server_filter(void *user_data, grpc_mdelem *md) {
if (strncmp(grpc_mdstr_as_c_string(md->value), "application/grpc+", 17) ==
0) {
/* Although the C implementation doesn't (currently) generate them,
any
custom +-suffix is explicitly valid. */
any custom +-suffix is explicitly valid. */
/* TODO(klempner): We should consider preallocating common values such
as +proto or +json, or at least stashing them if we see them. */
/* TODO(klempner): Should we be surfacing this to application code? */

@ -44,7 +44,7 @@
#include "src/core/security/credentials.h"
#include "src/core/surface/call.h"
#define MAX_CREDENTIAL_METADATA_COUNT 4
#define MAX_CREDENTIALS_METADATA_COUNT 4
/* We can have a per-call credentials. */
typedef struct {
@ -52,7 +52,7 @@ typedef struct {
grpc_mdstr *host;
grpc_mdstr *method;
grpc_call_op op;
grpc_linked_mdelem md_links[MAX_CREDENTIAL_METADATA_COUNT];
grpc_linked_mdelem md_links[MAX_CREDENTIALS_METADATA_COUNT];
} call_data;
/* We can have a per-channel credentials. */
@ -77,7 +77,7 @@ static void on_credentials_metadata(void *user_data, grpc_mdelem **md_elems,
call_data *calld = elem->call_data;
grpc_call_op op = calld->op;
size_t i;
GPR_ASSERT(num_md <= MAX_CREDENTIAL_METADATA_COUNT);
GPR_ASSERT(num_md <= MAX_CREDENTIALS_METADATA_COUNT);
for (i = 0; i < num_md; i++) {
grpc_metadata_batch_add_tail(&op.data.metadata, &calld->md_links[i],
grpc_mdelem_ref(md_elems[i]));

Loading…
Cancel
Save