aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-02-01 09:29:56 -0800
committerGravatar Craig Tiller <ctiller@google.com>2017-02-01 09:29:56 -0800
commit27ffc9b551f4df23598b8b9819012bfc57a3da88 (patch)
tree5780a612bc0947970d7bc774b11dff0175b095c8 /src
parenta5b1a89779b70b9bcf99ac1087b08fd5fb6fa253 (diff)
parent4040e13cc5b46a03c67bae8506668d54d978c56d (diff)
Merge github.com:grpc/grpc into bwest
Diffstat (limited to 'src')
-rw-r--r--src/core/ext/transport/cronet/transport/cronet_api_dummy.c2
-rw-r--r--src/core/ext/transport/cronet/transport/cronet_transport.c2
-rw-r--r--src/core/lib/surface/call.c24
-rw-r--r--src/objective-c/tests/CronetUnitTests/CronetUnitTests.m4
4 files changed, 22 insertions, 10 deletions
diff --git a/src/core/ext/transport/cronet/transport/cronet_api_dummy.c b/src/core/ext/transport/cronet/transport/cronet_api_dummy.c
index 74327a4214..da6c0b4fbc 100644
--- a/src/core/ext/transport/cronet/transport/cronet_api_dummy.c
+++ b/src/core/ext/transport/cronet/transport/cronet_api_dummy.c
@@ -38,7 +38,7 @@ library, so we can build it in all environments */
#include <grpc/support/log.h>
-#include "third_party/Cronet/bidirectional_stream_c.h"
+#include "third_party/objective_c/Cronet/bidirectional_stream_c.h"
#ifdef GRPC_COMPILE_WITH_CRONET
/* link with the real CRONET library in the build system */
diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.c b/src/core/ext/transport/cronet/transport/cronet_transport.c
index 419bfb7b7d..d755b1f147 100644
--- a/src/core/ext/transport/cronet/transport/cronet_transport.c
+++ b/src/core/ext/transport/cronet/transport/cronet_transport.c
@@ -51,7 +51,7 @@
#include "src/core/lib/transport/metadata_batch.h"
#include "src/core/lib/transport/static_metadata.h"
#include "src/core/lib/transport/transport_impl.h"
-#include "third_party/Cronet/bidirectional_stream_c.h"
+#include "third_party/objective_c/Cronet/bidirectional_stream_c.h"
#define GRPC_HEADER_SIZE_IN_BYTES 5
diff --git a/src/core/lib/surface/call.c b/src/core/lib/surface/call.c
index 5519a1ec7e..27097faaa6 100644
--- a/src/core/lib/surface/call.c
+++ b/src/core/lib/surface/call.c
@@ -242,10 +242,18 @@ static void post_batch_completion(grpc_exec_ctx *exec_ctx, batch_control *bctl);
static void add_batch_error(grpc_exec_ctx *exec_ctx, batch_control *bctl,
grpc_error *error);
+static void add_init_error(grpc_error **composite, grpc_error *new) {
+ if (new == GRPC_ERROR_NONE) return;
+ if (*composite == GRPC_ERROR_NONE)
+ *composite = GRPC_ERROR_CREATE("Call creation failed");
+ *composite = grpc_error_add_child(*composite, new);
+}
+
grpc_error *grpc_call_create(grpc_exec_ctx *exec_ctx,
const grpc_call_create_args *args,
grpc_call **out_call) {
size_t i, j;
+ grpc_error *error = GRPC_ERROR_NONE;
grpc_channel_stack *channel_stack =
grpc_channel_get_channel_stack(args->channel);
grpc_call *call;
@@ -308,8 +316,11 @@ grpc_error *grpc_call_create(grpc_exec_ctx *exec_ctx,
grpc_call_context_set(
call, GRPC_CONTEXT_TRACING,
args->parent_call->context[GRPC_CONTEXT_TRACING].value, NULL);
- } else {
- GPR_ASSERT(args->propagation_mask & GRPC_PROPAGATE_CENSUS_STATS_CONTEXT);
+ } else if (0 ==
+ (args->propagation_mask & GRPC_PROPAGATE_CENSUS_STATS_CONTEXT)) {
+ add_init_error(&error,
+ GRPC_ERROR_CREATE("Census tracing propagation requested "
+ "without Census context propagation"));
}
if (args->propagation_mask & GRPC_PROPAGATE_CANCELLATION) {
call->cancellation_is_inherited = 1;
@@ -332,10 +343,11 @@ grpc_error *grpc_call_create(grpc_exec_ctx *exec_ctx,
GRPC_CHANNEL_INTERNAL_REF(args->channel, "call");
/* initial refcount dropped by grpc_call_destroy */
- grpc_error *error = grpc_call_stack_init(
- exec_ctx, channel_stack, 1, destroy_call, call, call->context,
- args->server_transport_data, path, call->start_time, send_deadline,
- CALL_STACK_FROM_CALL(call));
+ add_init_error(&error, grpc_call_stack_init(exec_ctx, channel_stack, 1,
+ destroy_call, call, call->context,
+ args->server_transport_data, path,
+ call->start_time, send_deadline,
+ CALL_STACK_FROM_CALL(call)));
if (error != GRPC_ERROR_NONE) {
cancel_with_error(exec_ctx, call, GRPC_ERROR_REF(error));
}
diff --git a/src/objective-c/tests/CronetUnitTests/CronetUnitTests.m b/src/objective-c/tests/CronetUnitTests/CronetUnitTests.m
index 43b91a072b..599f840567 100644
--- a/src/objective-c/tests/CronetUnitTests/CronetUnitTests.m
+++ b/src/objective-c/tests/CronetUnitTests/CronetUnitTests.m
@@ -54,7 +54,7 @@
static void drain_cq(grpc_completion_queue *cq) {
grpc_event ev;
do {
- ev = grpc_completion_queue_next(cq, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL);
+ ev = grpc_completion_queue_next(cq, grpc_timeout_seconds_to_deadline(5), NULL);
} while (ev.type != GRPC_QUEUE_SHUTDOWN);
}
@@ -97,7 +97,7 @@ static void drain_cq(grpc_completion_queue *cq) {
grpc_slice_from_copied_string("hello world");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
- gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5);
+ gpr_timespec deadline = grpc_timeout_seconds_to_deadline(5);
grpc_metadata meta_c[2] = {
{"key1", "val1", 4, 0, {{NULL, NULL, NULL, NULL}}},
{"key2", "val2", 4, 0, {{NULL, NULL, NULL, NULL}}}};