aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp/Grpc.Core/Internal/RequestCallContextSafeHandle.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/csharp/Grpc.Core/Internal/RequestCallContextSafeHandle.cs')
-rw-r--r--src/csharp/Grpc.Core/Internal/RequestCallContextSafeHandle.cs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/csharp/Grpc.Core/Internal/RequestCallContextSafeHandle.cs b/src/csharp/Grpc.Core/Internal/RequestCallContextSafeHandle.cs
index ea7819d7b1..c1560bc8bf 100644
--- a/src/csharp/Grpc.Core/Internal/RequestCallContextSafeHandle.cs
+++ b/src/csharp/Grpc.Core/Internal/RequestCallContextSafeHandle.cs
@@ -66,8 +66,14 @@ namespace Grpc.Core.Internal
{
var call = Native.grpcsharp_request_call_context_call(this);
- var method = Marshal.PtrToStringAnsi(Native.grpcsharp_request_call_context_method(this));
- var host = Marshal.PtrToStringAnsi(Native.grpcsharp_request_call_context_host(this));
+ UIntPtr methodLen;
+ IntPtr methodPtr = Native.grpcsharp_request_call_context_method(this, out methodLen);
+ var method = Marshal.PtrToStringAnsi(methodPtr, (int) methodLen.ToUInt32());
+
+ UIntPtr hostLen;
+ IntPtr hostPtr = Native.grpcsharp_request_call_context_host(this, out hostLen);
+ var host = Marshal.PtrToStringAnsi(hostPtr, (int) hostLen.ToUInt32());
+
var deadline = Native.grpcsharp_request_call_context_deadline(this);
IntPtr metadataArrayPtr = Native.grpcsharp_request_call_context_request_metadata(this);