fixes for asan leak, and proxy test

freeing up payload_bytes.
returning GET response only once.
pull/7862/head
Makarand Dharmapurikar 8 years ago
parent d322d4b329
commit f44946bd9b
  1. 9
      src/core/lib/channel/http_client_filter.c
  2. 8
      src/core/lib/channel/http_server_filter.c

@ -153,7 +153,7 @@ static void hc_mutate_op(grpc_call_element *elem,
/* Decide which HTTP VERB to use */
grpc_mdelem *method = GRPC_MDELEM_METHOD_POST;
if ((op->send_initial_metadata_flags &
if (op->send_initial_metadata != NULL && (op->send_initial_metadata_flags &
GRPC_INITIAL_METADATA_CACHEABLE_REQUEST) &&
op->send_message != NULL &&
op->send_message->length < channeld->max_payload_size_for_get) {
@ -189,6 +189,8 @@ static void hc_mutate_op(grpc_call_element *elem,
break;
}
}
calld->on_complete = op->on_complete;
op->on_complete = &calld->hc_on_complete;
op->send_message = NULL;
}
@ -216,11 +218,6 @@ static void hc_mutate_op(grpc_call_element *elem,
calld->on_done_recv = op->recv_initial_metadata_ready;
op->recv_initial_metadata_ready = &calld->hc_on_recv;
}
if (op->on_complete != NULL && op->send_message != NULL) {
calld->on_complete = op->on_complete;
op->on_complete = &calld->hc_on_complete;
}
}
static void hc_start_transport_op(grpc_exec_ctx *exec_ctx,

@ -53,6 +53,9 @@ typedef struct call_data {
grpc_linked_mdelem status;
grpc_linked_mdelem content_type;
/* flag to ensure payload_bin is delivered only once */
uint8_t payload_bin_delivered;
grpc_metadata_batch *recv_initial_metadata;
bool *recv_idempotent_request;
bool *recv_cacheable_request;
@ -221,10 +224,13 @@ static void hs_on_complete(grpc_exec_ctx *exec_ctx, void *user_data,
call_data *calld = elem->call_data;
/* Call recv_message_ready if we got the payload via the header field */
if (calld->seen_payload_bin && calld->recv_message_ready != NULL) {
*calld->pp_recv_message = (grpc_byte_stream *)&calld->read_stream;
*calld->pp_recv_message = calld->payload_bin_delivered
? NULL
: (grpc_byte_stream *)&calld->read_stream;
calld->recv_message_ready->cb(exec_ctx, calld->recv_message_ready->cb_arg,
err);
calld->recv_message_ready = NULL;
calld->payload_bin_delivered = true;
}
calld->on_complete->cb(exec_ctx, calld->on_complete->cb_arg, err);
}

Loading…
Cancel
Save