[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.
- [gnurl] 236/282: tests: try to make sleeping portable by avoiding select, (continued)
- [gnurl] 236/282: tests: try to make sleeping portable by avoiding select, gnunet, 2020/04/01
- [gnurl] 233/282: RELEASE-NOTES: 7.69.0, gnunet, 2020/04/01
- [gnurl] 244/282: urldata: remove the 'stream_was_rewound' connectdata struct member, gnunet, 2020/04/01
- [gnurl] 229/282: ci/tests: Make it possible to still run but ignore failing tests, gnunet, 2020/04/01
- [gnurl] 235/282: runtests.1: rephrase how to specify what tests to run, gnunet, 2020/04/01
- [gnurl] 241/282: MANUAL: update a dict-using command line, gnunet, 2020/04/01
- [gnurl] 232/282: THANKS: from 7.69.0, gnunet, 2020/04/01
- [gnurl] 245/282: transfer: set correct copyright year range, gnunet, 2020/04/01
- [gnurl] 239/282: polarssl: remove more references and mentions, gnunet, 2020/04/01
- [gnurl] 242/282: RELEASE-NOTES: synced, gnunet, 2020/04/01
- [gnurl] 248/282: pause: return early for calls that don't change pause state,
gnunet <=
- [gnurl] 249/282: unit1612: fixed the inclusion and compilation of the HMAC unit test, gnunet, 2020/04/01
- [gnurl] 250/282: pause: bail out on bad input, gnunet, 2020/04/01
- [gnurl] 247/282: curl_share_setopt.3: Note sharing cookies doesn't enable the engine, gnunet, 2020/04/01
- [gnurl] 257/282: perl: align order and completeness of Windows OS checks, gnunet, 2020/04/01
- [gnurl] 258/282: tests: use native Sleep function as fallback on Windows, gnunet, 2020/04/01
- [gnurl] 259/282: RELEASE-NOTES: synced, gnunet, 2020/04/01
- [gnurl] 234/282: cirrus-ci: disable the FreeBSD 13 builds, gnunet, 2020/04/01
- [gnurl] 243/282: Revert "pause: force-drain the transfer on unpause", gnunet, 2020/04/01
- [gnurl] 240/282: KNOWN_BUGS: configure --with-gssapi with Heimdal is ignored on macOS, gnunet, 2020/04/01
- [gnurl] 252/282: socks5: switch state properly when the resolve is done, gnunet, 2020/04/01