aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/security/secure_endpoint.c
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-07-05 21:08:33 -0700
committerGravatar Craig Tiller <craig.tiller@gmail.com>2015-07-05 21:08:33 -0700
commit27166a6f65581a9ee820882e5d7506d6bd07ade6 (patch)
tree0e89c5e09a955b2a074a8b34e0f3fe0a4135f346 /src/core/security/secure_endpoint.c
parent4efb6966bdfb62c725c6614b0d85ea374250bb51 (diff)
parentd1dd3a68a2d4af56f1409327c197590dac6968cb (diff)
Merge github.com:grpc/grpc into flow-like-lava-to-a-barnyard
Conflicts: src/core/surface/call.c src/core/transport/chttp2_transport.c src/core/transport/transport.h
Diffstat (limited to 'src/core/security/secure_endpoint.c')
-rw-r--r--src/core/security/secure_endpoint.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core/security/secure_endpoint.c b/src/core/security/secure_endpoint.c
index 7bb1de4413..73496d1153 100644
--- a/src/core/security/secure_endpoint.c
+++ b/src/core/security/secure_endpoint.c
@@ -116,7 +116,7 @@ static void on_read(void *user_data, gpr_slice *slices, size_t nslices,
grpc_endpoint_cb_status error) {
unsigned i;
gpr_uint8 keep_looping = 0;
- int input_buffer_count = 0;
+ size_t input_buffer_count = 0;
tsi_result result = TSI_OK;
secure_endpoint *ep = (secure_endpoint *)user_data;
gpr_uint8 *cur = GPR_SLICE_START_PTR(ep->read_staging_buffer);
@@ -129,7 +129,7 @@ static void on_read(void *user_data, gpr_slice *slices, size_t nslices,
size_t message_size = GPR_SLICE_LENGTH(encrypted);
while (message_size > 0 || keep_looping) {
- size_t unprotected_buffer_size_written = end - cur;
+ size_t unprotected_buffer_size_written = (size_t)(end - cur);
size_t processed_message_size = message_size;
gpr_mu_lock(&ep->protector_mu);
result = tsi_frame_protector_unprotect(ep->protector, message_bytes,
@@ -166,7 +166,7 @@ static void on_read(void *user_data, gpr_slice *slices, size_t nslices,
&ep->input_buffer,
gpr_slice_split_head(
&ep->read_staging_buffer,
- cur - GPR_SLICE_START_PTR(ep->read_staging_buffer)));
+ (size_t)(cur - GPR_SLICE_START_PTR(ep->read_staging_buffer))));
}
/* TODO(yangg) experiment with moving this block after read_cb to see if it
@@ -225,7 +225,7 @@ static grpc_endpoint_write_status endpoint_write(grpc_endpoint *secure_ep,
grpc_endpoint_write_cb cb,
void *user_data) {
unsigned i;
- int output_buffer_count = 0;
+ size_t output_buffer_count = 0;
tsi_result result = TSI_OK;
secure_endpoint *ep = (secure_endpoint *)secure_ep;
gpr_uint8 *cur = GPR_SLICE_START_PTR(ep->write_staging_buffer);
@@ -248,7 +248,7 @@ static grpc_endpoint_write_status endpoint_write(grpc_endpoint *secure_ep,
gpr_uint8 *message_bytes = GPR_SLICE_START_PTR(plain);
size_t message_size = GPR_SLICE_LENGTH(plain);
while (message_size > 0) {
- size_t protected_buffer_size_to_send = end - cur;
+ size_t protected_buffer_size_to_send = (size_t)(end - cur);
size_t processed_message_size = message_size;
gpr_mu_lock(&ep->protector_mu);
result = tsi_frame_protector_protect(ep->protector, message_bytes,
@@ -273,7 +273,7 @@ static grpc_endpoint_write_status endpoint_write(grpc_endpoint *secure_ep,
if (result == TSI_OK) {
size_t still_pending_size;
do {
- size_t protected_buffer_size_to_send = end - cur;
+ size_t protected_buffer_size_to_send = (size_t)(end - cur);
gpr_mu_lock(&ep->protector_mu);
result = tsi_frame_protector_protect_flush(ep->protector, cur,
&protected_buffer_size_to_send,
@@ -290,7 +290,7 @@ static grpc_endpoint_write_status endpoint_write(grpc_endpoint *secure_ep,
&ep->output_buffer,
gpr_slice_split_head(
&ep->write_staging_buffer,
- cur - GPR_SLICE_START_PTR(ep->write_staging_buffer)));
+ (size_t)(cur - GPR_SLICE_START_PTR(ep->write_staging_buffer))));
}
}