diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2015-08-08 01:45:38 +0200 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2015-08-08 01:45:38 +0200 |
commit | 9d72b149a9e3462c2fa13afa27a1e52bfe7bf186 (patch) | |
tree | eedff1af6f56fc97e61c3bee236b109b6d007d69 /src/csharp/ext | |
parent | f75df57a8ffaddb11f064dfa5e54ec8404a81e08 (diff) | |
parent | 95a98ca768683f3864b1aefc9d6f266b22705b2a (diff) |
Merge branch 'master' of github.com:grpc/grpc into the-ultimate-showdown
Conflicts:
include/grpc/grpc.h
src/core/surface/channel.c
src/core/surface/channel_create.c
src/core/surface/completion_queue.c
src/cpp/client/channel.cc
src/cpp/client/insecure_credentials.cc
src/csharp/ext/grpc_csharp_ext.c
src/node/ext/call.cc
src/node/ext/channel.cc
src/php/ext/grpc/call.c
src/php/ext/grpc/channel.c
src/python/grpcio/grpc/_adapter/_c/types/channel.c
src/ruby/ext/grpc/rb_channel.c
test/core/end2end/dualstack_socket_test.c
test/core/end2end/fixtures/chttp2_fullstack.c
test/core/end2end/fixtures/chttp2_fullstack_compression.c
test/core/end2end/fixtures/chttp2_fullstack_uds_posix.c
test/core/end2end/fixtures/chttp2_fullstack_with_poll.c
test/core/end2end/multiple_server_queues_test.c
test/core/end2end/no_server_test.c
test/core/end2end/tests/bad_hostname.c
test/core/end2end/tests/cancel_after_accept.c
test/core/end2end/tests/cancel_after_accept_and_writes_closed.c
test/core/end2end/tests/cancel_after_invoke.c
test/core/end2end/tests/cancel_before_invoke.c
test/core/end2end/tests/cancel_in_a_vacuum.c
test/core/end2end/tests/census_simple_request.c
test/core/end2end/tests/disappearing_server.c
test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c
test/core/end2end/tests/empty_batch.c
test/core/end2end/tests/graceful_server_shutdown.c
test/core/end2end/tests/invoke_large_request.c
test/core/end2end/tests/max_concurrent_streams.c
test/core/end2end/tests/max_message_length.c
test/core/end2end/tests/ping_pong_streaming.c
test/core/end2end/tests/registered_call.c
test/core/end2end/tests/request_response_with_binary_metadata_and_payload.c
test/core/end2end/tests/request_response_with_metadata_and_payload.c
test/core/end2end/tests/request_response_with_payload.c
test/core/end2end/tests/request_response_with_payload_and_call_creds.c
test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.c
test/core/end2end/tests/request_with_compressed_payload.c
test/core/end2end/tests/request_with_flags.c
test/core/end2end/tests/request_with_large_metadata.c
test/core/end2end/tests/request_with_payload.c
test/core/end2end/tests/server_finishes_request.c
test/core/end2end/tests/simple_delayed_request.c
test/core/end2end/tests/simple_request.c
test/core/end2end/tests/simple_request_with_high_initial_sequence_number.c
test/core/fling/client.c
test/core/fling/server.c
test/core/surface/lame_client_test.c
Diffstat (limited to 'src/csharp/ext')
-rw-r--r-- | src/csharp/ext/grpc_csharp_ext.c | 82 |
1 files changed, 58 insertions, 24 deletions
diff --git a/src/csharp/ext/grpc_csharp_ext.c b/src/csharp/ext/grpc_csharp_ext.c index c7957f1441..d28ce1b383 100644 --- a/src/csharp/ext/grpc_csharp_ext.c +++ b/src/csharp/ext/grpc_csharp_ext.c @@ -169,7 +169,7 @@ grpcsharp_metadata_array_add(grpc_metadata_array *array, const char *key, GPR_EXPORT gpr_intptr GPR_CALLTYPE grpcsharp_metadata_array_count(grpc_metadata_array *array) { - return (gpr_intptr) array->count; + return (gpr_intptr)array->count; } GPR_EXPORT const char *GPR_CALLTYPE @@ -184,10 +184,10 @@ grpcsharp_metadata_array_get_value(grpc_metadata_array *array, size_t index) { return array->metadata[index].value; } -GPR_EXPORT gpr_intptr GPR_CALLTYPE -grpcsharp_metadata_array_get_value_length(grpc_metadata_array *array, size_t index) { +GPR_EXPORT gpr_intptr GPR_CALLTYPE grpcsharp_metadata_array_get_value_length( + grpc_metadata_array *array, size_t index) { GPR_ASSERT(index < array->count); - return (gpr_intptr) array->metadata[index].value_length; + return (gpr_intptr)array->metadata[index].value_length; } /* Move contents of metadata array */ @@ -306,8 +306,7 @@ grpcsharp_batch_context_server_rpc_new_method( return ctx->server_rpc_new.call_details.method; } -GPR_EXPORT const char *GPR_CALLTYPE -grpcsharp_batch_context_server_rpc_new_host( +GPR_EXPORT const char *GPR_CALLTYPE grpcsharp_batch_context_server_rpc_new_host( const grpcsharp_batch_context *ctx) { return ctx->server_rpc_new.call_details.host; } @@ -368,8 +367,9 @@ grpcsharp_completion_queue_pluck(grpc_completion_queue *cq, void *tag) { /* Channel */ GPR_EXPORT grpc_channel *GPR_CALLTYPE -grpcsharp_channel_create(const char *target, const grpc_channel_args *args) { - return grpc_channel_create(target, args, NULL); + +grpcsharp_insecure_channel_create(const char *target, const grpc_channel_args *args) { + return grpc_insecure_channel_create(target, args, NULL); } GPR_EXPORT void GPR_CALLTYPE grpcsharp_channel_destroy(grpc_channel *channel) { @@ -380,7 +380,24 @@ GPR_EXPORT grpc_call *GPR_CALLTYPE grpcsharp_channel_create_call(grpc_channel *channel, grpc_completion_queue *cq, const char *method, const char *host, gpr_timespec deadline) { - return grpc_channel_create_call(channel, cq, method, host, deadline, NULL); + return grpc_channel_create_call(channel, NULL, GRPC_PROPAGATE_DEFAULTS, cq, + method, host, deadline, NULL); +} + +GPR_EXPORT grpc_connectivity_state GPR_CALLTYPE +grpcsharp_channel_check_connectivity_state(grpc_channel *channel, gpr_int32 try_to_connect) { + return grpc_channel_check_connectivity_state(channel, try_to_connect); +} + +GPR_EXPORT void GPR_CALLTYPE grpcsharp_channel_watch_connectivity_state( + grpc_channel *channel, grpc_connectivity_state last_observed_state, + gpr_timespec deadline, grpc_completion_queue *cq, grpcsharp_batch_context *ctx) { + grpc_channel_watch_connectivity_state(channel, last_observed_state, + deadline, cq, ctx); +} + +GPR_EXPORT char *GPR_CALLTYPE grpcsharp_channel_get_target(grpc_channel *channel) { + return grpc_channel_get_target(channel); } /* Channel args */ @@ -434,10 +451,20 @@ grpcsharp_channel_args_destroy(grpc_channel_args *args) { /* Timespec */ -GPR_EXPORT gpr_timespec GPR_CALLTYPE gprsharp_now(void) { return gpr_now(GPR_CLOCK_REALTIME); } +GPR_EXPORT gpr_timespec GPR_CALLTYPE gprsharp_now(gpr_clock_type clock_type) { + return gpr_now(clock_type); +} -GPR_EXPORT gpr_timespec GPR_CALLTYPE gprsharp_inf_future(void) { - return gpr_inf_future(GPR_CLOCK_REALTIME); +GPR_EXPORT gpr_timespec GPR_CALLTYPE gprsharp_inf_future(gpr_clock_type clock_type) { + return gpr_inf_future(clock_type); +} + +GPR_EXPORT gpr_timespec GPR_CALLTYPE gprsharp_inf_past(gpr_clock_type clock_type) { + return gpr_inf_past(clock_type); +} + +GPR_EXPORT gpr_timespec GPR_CALLTYPE gprsharp_convert_clock_type(gpr_timespec t, gpr_clock_type target_clock) { + return gpr_convert_clock_type(t, target_clock); } GPR_EXPORT gpr_int32 GPR_CALLTYPE gprsharp_sizeof_timespec(void) { @@ -456,6 +483,14 @@ grpcsharp_call_cancel_with_status(grpc_call *call, grpc_status_code status, return grpc_call_cancel_with_status(call, status, description, NULL); } +GPR_EXPORT char *GPR_CALLTYPE grpcsharp_call_get_peer(grpc_call *call) { + return grpc_call_get_peer(call); +} + +GPR_EXPORT void GPR_CALLTYPE gprsharp_free(void *p) { + gpr_free(p); +} + GPR_EXPORT void GPR_CALLTYPE grpcsharp_call_destroy(grpc_call *call) { grpc_call_destroy(call); } @@ -645,20 +680,17 @@ grpcsharp_call_send_close_from_client(grpc_call *call, NULL); } -GPR_EXPORT grpc_call_error GPR_CALLTYPE -grpcsharp_call_send_status_from_server(grpc_call *call, - grpcsharp_batch_context *ctx, - grpc_status_code status_code, - const char *status_details, - grpc_metadata_array *trailing_metadata) { +GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_send_status_from_server( + grpc_call *call, grpcsharp_batch_context *ctx, grpc_status_code status_code, + const char *status_details, grpc_metadata_array *trailing_metadata) { /* TODO: don't use magic number */ grpc_op ops[1]; ops[0].op = GRPC_OP_SEND_STATUS_FROM_SERVER; ops[0].data.send_status_from_server.status = status_code; ops[0].data.send_status_from_server.status_details = gpr_strdup(status_details); - grpcsharp_metadata_array_move(&(ctx->send_status_from_server.trailing_metadata), - trailing_metadata); + grpcsharp_metadata_array_move( + &(ctx->send_status_from_server.trailing_metadata), trailing_metadata); ops[0].data.send_status_from_server.trailing_metadata_count = ctx->send_status_from_server.trailing_metadata.count; ops[0].data.send_status_from_server.trailing_metadata = @@ -709,8 +741,8 @@ grpcsharp_server_create(grpc_completion_queue *cq, } GPR_EXPORT gpr_int32 GPR_CALLTYPE -grpcsharp_server_add_http2_port(grpc_server *server, const char *addr) { - return grpc_server_add_http2_port(server, addr); +grpcsharp_server_add_insecure_http2_port(grpc_server *server, const char *addr) { + return grpc_server_add_insecure_http2_port(server, addr); } GPR_EXPORT void GPR_CALLTYPE grpcsharp_server_start(grpc_server *server) { @@ -771,7 +803,8 @@ grpcsharp_secure_channel_create(grpc_credentials *creds, const char *target, GPR_EXPORT grpc_server_credentials *GPR_CALLTYPE grpcsharp_ssl_server_credentials_create( const char *pem_root_certs, const char **key_cert_pair_cert_chain_array, - const char **key_cert_pair_private_key_array, size_t num_key_cert_pairs) { + const char **key_cert_pair_private_key_array, size_t num_key_cert_pairs, + int force_client_auth) { size_t i; grpc_server_credentials *creds; grpc_ssl_pem_key_cert_pair *key_cert_pairs = @@ -787,7 +820,8 @@ grpcsharp_ssl_server_credentials_create( } } creds = grpc_ssl_server_credentials_create(pem_root_certs, key_cert_pairs, - num_key_cert_pairs); + num_key_cert_pairs, + force_client_auth); gpr_free(key_cert_pairs); return creds; } |