[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 174/264: schannel: Fix blocking timeout logic
From: |
gnunet |
Subject: |
[gnurl] 174/264: schannel: Fix blocking timeout logic |
Date: |
Thu, 30 Apr 2020 16:07:57 +0200 |
This is an automated email from the git hooks/post-receive script.
nikita pushed a commit to branch master
in repository gnurl.
commit c35af292227a0e89ef3362d34959dc75ea98fd92
Author: Andrew Kurushin <address@hidden>
AuthorDate: Sun Apr 12 13:07:51 2020 +0300
schannel: Fix blocking timeout logic
- Fix schannel_send for the case when no timeout was set.
Prior to this change schannel would error if the socket was not ready
to send data and no timeout was set.
This commit is similar to parent commit 89dc6e0 which recently made the
same change for SOCKS, for the same reason. Basically it was not well
understood that when Curl_timeleft returns 0 it is not a timeout of 0 ms
but actually means no timeout.
Fixes https://github.com/curl/curl/issues/5177
Closes https://github.com/curl/curl/pull/5221
---
lib/vtls/schannel.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c
index cb70d5309..96c1dbc67 100644
--- a/lib/vtls/schannel.c
+++ b/lib/vtls/schannel.c
@@ -1631,13 +1631,13 @@ schannel_send(struct connectdata *conn, int sockindex,
/* send entire message or fail */
while(len > (size_t)written) {
ssize_t this_write;
- timediff_t timeleft;
+ timediff_t timeout_ms;
int what;
this_write = 0;
- timeleft = Curl_timeleft(conn->data, NULL, FALSE);
- if(timeleft < 0) {
+ timeout_ms = Curl_timeleft(conn->data, NULL, FALSE);
+ if(timeout_ms < 0) {
/* we already got the timeout */
failf(conn->data, "schannel: timed out sending data "
"(bytes sent: %zd)", written);
@@ -1645,9 +1645,9 @@ schannel_send(struct connectdata *conn, int sockindex,
written = -1;
break;
}
- if(timeleft > TIME_T_MAX)
- timeleft = TIME_T_MAX;
- what = SOCKET_WRITABLE(conn->sock[sockindex], (time_t)timeleft);
+ if(!timeout_ms || timeout_ms > TIME_T_MAX)
+ timeout_ms = TIME_T_MAX;
+ what = SOCKET_WRITABLE(conn->sock[sockindex], (time_t)timeout_ms);
if(what < 0) {
/* fatal error */
failf(conn->data, "select/poll on SSL socket, errno: %d", SOCKERRNO);
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 262/264: RELEASE-NOTES: 7.70.0, (continued)
- [gnurl] 262/264: RELEASE-NOTES: 7.70.0, gnunet, 2020/04/30
- [gnurl] 159/264: lib: fix conversion warnings for SOCKET_WRITABLE/READABLE, gnunet, 2020/04/30
- [gnurl] 182/264: mqtt: add new experimental protocol, gnunet, 2020/04/30
- [gnurl] 145/264: http: don't consider upload done if the request isn't completely sent off, gnunet, 2020/04/30
- [gnurl] 181/264: TODO: Consider convenience options for JSON and XML?, gnunet, 2020/04/30
- [gnurl] 143/264: connect: store connection info for QUIC connections, gnunet, 2020/04/30
- [gnurl] 148/264: runtests: provide nicer errormsg when protocol "dump" file is empty, gnunet, 2020/04/30
- [gnurl] 258/264: nss: check for PK11_CreateDigestContext() returning NULL, gnunet, 2020/04/30
- [gnurl] 151/264: runtests: fix warning about using an undefined variable, gnunet, 2020/04/30
- [gnurl] 153/264: url: allow non-HTTPS altsvc-matching for debug builds, gnunet, 2020/04/30
- [gnurl] 174/264: schannel: Fix blocking timeout logic,
gnunet <=
- [gnurl] 123/264: test1566: verify --etag-compare that gets a 304 back, gnunet, 2020/04/30
- [gnurl] 158/264: test1148: tolerate progress updates better (again), gnunet, 2020/04/30
- [gnurl] 149/264: github actions: run when pushed to master or */ci + PRs, gnunet, 2020/04/30
- [gnurl] 185/264: tests: add four MQTT tests 1190 - 1193, gnunet, 2020/04/30
- [gnurl] 189/264: scripts/release-notes: fix duplicate output header, gnunet, 2020/04/30
- [gnurl] 121/264: curl: allow both --etag-compare and --etag-save with same file name, gnunet, 2020/04/30
- [gnurl] 146/264: tests: verify split initial HTTP requests with CURL_SMALLREQSEND, gnunet, 2020/04/30
- [gnurl] 212/264: test1245: make it work with dynamic FTP server port, gnunet, 2020/04/30
- [gnurl] 245/264: test1154: set a proper name, gnunet, 2020/04/30
- [gnurl] 147/264: schannel: support .P12 or .PFX client certificates, gnunet, 2020/04/30