From cf62d4b25f17edfce68bf6c43be7a929b95ebb11 Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Sun, 20 Nov 2016 12:05:14 +0100 Subject: [PATCH] GH-341 Set timeout for the IPC to 2sec. --- NeoVimServer/NeoVimServer.m | 4 ++-- SwiftNeoVim/NeoVimAgent.m | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/NeoVimServer/NeoVimServer.m b/NeoVimServer/NeoVimServer.m index f56f7464..5773b25c 100644 --- a/NeoVimServer/NeoVimServer.m +++ b/NeoVimServer/NeoVimServer.m @@ -15,7 +15,7 @@ //#define DEBUG_NEOVIM_SERVER_STANDALONE -static const double qTimeout = 10.0; +static const double qTimeout = 2; #define data_to_array(type) \ static type *data_to_ ## type ## _array(NSData *data, NSUInteger count) { \ @@ -148,7 +148,7 @@ static CFDataRef local_server_callback(CFMessagePortRef local, SInt32 msgid, CFD #ifdef DEBUG_NEOVIM_SERVER_STANDALONE return; #endif - + if (_remoteServerPort == NULL) { WLOG("Remote server is null: The msg (%lu:%s) could not be sent.", (unsigned long) msgid, data.cdesc); return; diff --git a/SwiftNeoVim/NeoVimAgent.m b/SwiftNeoVim/NeoVimAgent.m index f047152a..e2c18d70 100644 --- a/SwiftNeoVim/NeoVimAgent.m +++ b/SwiftNeoVim/NeoVimAgent.m @@ -11,7 +11,7 @@ #import "NeoVimWindow.h" -static const double qTimeout = 10; +static const double qTimeout = 2; #define data_to_array(type) \ static type *data_to_ ## type ## _array(NSData *data, NSUInteger count) { \ @@ -232,7 +232,7 @@ static CFDataRef local_server_callback(CFMessagePortRef local, SInt32 msgid, CFD log4Warn("The response for the msg %lu was nil.", NeoVimAgentMsgIdGetDirtyDocs); return YES; } - + bool *values = data_to_bool_array(response, 1); return values[0]; }