summaryrefslogtreecommitdiffstats
path: root/abs/core/curl/0001-singlesocket-fix-the-sincebefore-placement.patch
blob: ecbed6298ac1a271d6f67eca1ad45ac14b2b237f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
From b7753be57d7bdb6b909f1a0a4207950e18100d79 Mon Sep 17 00:00:00 2001
Message-Id: <b7753be57d7bdb6b909f1a0a4207950e18100d79.1550588688.git.jan.steffens@gmail.com>
From: Daniel Stenberg <daniel@haxx.se>
Date: Tue, 19 Feb 2019 15:56:54 +0100
Subject: [PATCH] singlesocket: fix the 'sincebefore' placement

The variable wasn't properly reset within the loop and thus could remain
set for sockets that hadn't been set before and thus missed notifying
the app.

Detected-by: Jan Alexander Steffens
Fixes #3585
---
 lib/multi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/multi.c b/lib/multi.c
index aaae8b978..521262b2b 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -2349,26 +2349,26 @@ static CURLMcode singlesocket(struct Curl_multi *multi,
   int num;
   unsigned int curraction;
   int actions[MAX_SOCKSPEREASYHANDLE];
-  unsigned int comboaction;
-  bool sincebefore = FALSE;
 
   for(i = 0; i< MAX_SOCKSPEREASYHANDLE; i++)
     socks[i] = CURL_SOCKET_BAD;
 
   /* Fill in the 'current' struct with the state as it is now: what sockets to
      supervise and for what actions */
   curraction = multi_getsock(data, socks, MAX_SOCKSPEREASYHANDLE);
 
   /* We have 0 .. N sockets already and we get to know about the 0 .. M
      sockets we should have from now on. Detect the differences, remove no
      longer supervised ones and add new ones */
 
   /* walk over the sockets we got right now */
   for(i = 0; (i< MAX_SOCKSPEREASYHANDLE) &&
         (curraction & (GETSOCK_READSOCK(i) | GETSOCK_WRITESOCK(i)));
       i++) {
     unsigned int action = CURL_POLL_NONE;
     unsigned int prevaction = 0;
+    unsigned int comboaction;
+    bool sincebefore = FALSE;
 
     s = socks[i];
 
-- 
2.20.1