diff options
author | Muxi Yan <mxyan@google.com> | 2017-09-11 15:48:51 -0700 |
---|---|---|
committer | Muxi Yan <mxyan@google.com> | 2017-09-11 15:48:51 -0700 |
commit | f6e61bf7686bfce40d4f3912fd9eeb2ba6987e62 (patch) | |
tree | 5648dcdffd1d1e63c384d53acb6cb9b6062fdff2 /src/objective-c/GRPCClient/private/GRPCChannel.m | |
parent | afa47005015295e65b932403142938f9bb9b72fc (diff) |
Add comment for timeout; assert on negative timeout value; fix timeout test
Diffstat (limited to 'src/objective-c/GRPCClient/private/GRPCChannel.m')
-rw-r--r-- | src/objective-c/GRPCClient/private/GRPCChannel.m | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCChannel.m b/src/objective-c/GRPCClient/private/GRPCChannel.m index 2eb0211550..b78b14f2af 100644 --- a/src/objective-c/GRPCClient/private/GRPCChannel.m +++ b/src/objective-c/GRPCClient/private/GRPCChannel.m @@ -184,6 +184,10 @@ static grpc_channel_args *BuildChannelArgs(NSDictionary *dictionary) { serverName:(NSString *)serverName timeout:(NSTimeInterval)timeout completionQueue:(GRPCCompletionQueue *)queue { + GPR_ASSERT(timeout >= 0); + if (timeout < 0) { + timeout = 0; + } grpc_slice host_slice; if (serverName) { host_slice = grpc_slice_from_copied_string(serverName.UTF8String); |