gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnurl] 248/282: pause: return early for calls that don't change pause s


From: gnunet
Subject: [gnurl] 248/282: pause: return early for calls that don't change pause state
Date: Wed, 01 Apr 2020 14:31:53 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository gnurl.

commit 64258bd0aa6ad23195f6be32e6febf7439ab7984
Author: Daniel Stenberg <address@hidden>
AuthorDate: Tue Mar 3 08:10:09 2020 +0100

    pause: return early for calls that don't change pause state
    
    Reviewed-by: Patrick Monnerat
    Ref: #4833
    Closes #5026
---
 lib/easy.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/easy.c b/lib/easy.c
index 454621076..2446557f4 100644
--- a/lib/easy.c
+++ b/lib/easy.c
@@ -975,6 +975,7 @@ CURLcode curl_easy_pause(struct Curl_easy *data, int action)
 {
   struct SingleRequest *k = &data->req;
   CURLcode result = CURLE_OK;
+  int oldstate = k->keepon & (KEEP_RECV_PAUSE| KEEP_SEND_PAUSE);
 
   /* first switch off both pause bits */
   int newstate = k->keepon &~ (KEEP_RECV_PAUSE| KEEP_SEND_PAUSE);
@@ -983,6 +984,12 @@ CURLcode curl_easy_pause(struct Curl_easy *data, int 
action)
   newstate |= ((action & CURLPAUSE_RECV)?KEEP_RECV_PAUSE:0) |
     ((action & CURLPAUSE_SEND)?KEEP_SEND_PAUSE:0);
 
+  if((newstate & (KEEP_RECV_PAUSE| KEEP_SEND_PAUSE)) == oldstate) {
+    /* Not changing any pause state, return */
+    DEBUGF(infof(data, "pause: no change, early return\n"));
+    return CURLE_OK;
+  }
+
   /* put it back in the keepon */
   k->keepon = newstate;
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]