Commit: patch 9.1.0639: channel timeout may wrap around

2 views
Skip to first unread message

Christian Brabandt

unread,
Jul 29, 2024, 2:45:09 PM7/29/24
to vim...@googlegroups.com
patch 9.1.0639: channel timeout may wrap around

Commit: https://github.com/vim/vim/commit/0bee82b1d0a46a6ca6fb4ffcebd6a63d4141a355
Author: Ken Takata <ken...@csc.jp>
Date: Mon Jul 29 20:39:12 2024 +0200

patch 9.1.0639: channel timeout may wrap around

Problem: channel timeout may wrap around
Solution: Correct timeout calculation when GetTickCount() wraps around
(Ken Takata)

closes: #15390

Signed-off-by: Ken Takata <ken...@csc.jp>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/channel.c b/src/channel.c
index b99b3a90a..69bbff24e 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -2277,7 +2277,7 @@ channel_parse_json(channel_T *channel, ch_part_T part)
{
int timeout;
#ifdef MSWIN
- timeout = GetTickCount() > chanpart->ch_deadline;
+ timeout = (int)(GetTickCount() - chanpart->ch_deadline) > 0;
#else
{
struct timeval now_tv;
diff --git a/src/version.c b/src/version.c
index f8d1762b8..97414a08a 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 639,
/**/
638,
/**/
Reply all
Reply to author
Forward
0 new messages