Add missing pieces

pull/2313/head
yang-g 10 years ago
parent 3315a845ef
commit d53bc8925b
  1. 5
      src/cpp/common/secure_create_auth_context.cc
  2. 3
      test/core/end2end/tests/request_response_with_payload_and_call_creds.c

@ -43,9 +43,8 @@ std::shared_ptr<const AuthContext> CreateAuthContext(grpc_call* call) {
if (call == nullptr) { if (call == nullptr) {
return std::shared_ptr<const AuthContext>(); return std::shared_ptr<const AuthContext>();
} }
grpc_auth_context* context = return std::shared_ptr<const AuthContext>(
const_cast<grpc_auth_context*>(grpc_call_auth_context(call)); new SecureAuthContext(grpc_call_auth_context(call)));
return std::shared_ptr<const AuthContext>(new SecureAuthContext(context));
} }
} // namespace grpc } // namespace grpc

@ -173,7 +173,7 @@ static void request_response_with_payload_and_call_creds(
size_t details_capacity = 0; size_t details_capacity = 0;
int was_cancelled = 2; int was_cancelled = 2;
grpc_credentials *creds = NULL; grpc_credentials *creds = NULL;
const grpc_auth_context *s_auth_context = NULL; grpc_auth_context *s_auth_context = NULL;
c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr", c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
deadline); deadline);
@ -239,6 +239,7 @@ static void request_response_with_payload_and_call_creds(
s_auth_context = grpc_call_auth_context(s); s_auth_context = grpc_call_auth_context(s);
GPR_ASSERT(s_auth_context != NULL); GPR_ASSERT(s_auth_context != NULL);
print_auth_context(0, s_auth_context); print_auth_context(0, s_auth_context);
grpc_auth_context_release(s_auth_context);
/* Cannot set creds on the server call object. */ /* Cannot set creds on the server call object. */
GPR_ASSERT(grpc_call_set_credentials(s, NULL) != GRPC_CALL_OK); GPR_ASSERT(grpc_call_set_credentials(s, NULL) != GRPC_CALL_OK);

Loading…
Cancel
Save