diff options
author | Mark D. Roth <roth@google.com> | 2017-09-25 12:36:30 -0700 |
---|---|---|
committer | Mark D. Roth <roth@google.com> | 2017-09-25 12:36:30 -0700 |
commit | b4c01f9e2982d61723014f76c42fc059c554b084 (patch) | |
tree | 7ac46ab54a86744ae26317a2365e0f9fe8647812 /src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi | |
parent | ad9208c07e74d90dd5110324fe9cb830e6e6f68b (diff) | |
parent | 008a173a7e2ba1d5c0933aa7a77395945ba2024d (diff) |
Merge remote-tracking branch 'upstream/master' into plugin_credentials_api_fix
Diffstat (limited to 'src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi')
-rw-r--r-- | src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi index fa89b8d55a..f73dbe4a9d 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi @@ -77,7 +77,7 @@ cdef class CredentialsMetadataPlugin: """ Args: plugin_callback (callable): Callback accepting a service URL (str/bytes) - and callback object (accepting a Metadata, + and callback object (accepting a MetadataArray, grpc_status_code, and a str/bytes error message). This argument when called should be non-blocking and eventually call the callback object with the appropriate status code/details and metadata (if @@ -133,8 +133,7 @@ cdef int plugin_get_metadata( def python_callback( Metadata metadata, grpc_status_code status, bytes error_details): - cb(user_data, metadata.c_metadata_array.metadata, - metadata.c_metadata_array.count, status, error_details) + cb(user_data, metadata.c_metadata, metadata.c_count, status, error_details) called_flag[0] = True cdef CredentialsMetadataPlugin self = <CredentialsMetadataPlugin>state cdef AuthMetadataContext cy_context = AuthMetadataContext() @@ -144,8 +143,8 @@ cdef int plugin_get_metadata( self.plugin_callback(cy_context, python_callback) except Exception as error: if not called_flag[0]: - cb(user_data, Metadata([]).c_metadata_array.metadata, - 0, StatusCode.unknown, traceback.format_exc().encode()) + cb(user_data, NULL, 0, StatusCode.unknown, + traceback.format_exc().encode()) threading.Thread(group=None, target=async_callback).start() return 0 # Asynchronous return |