summaryrefslogtreecommitdiff
path: root/cups/http.c
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2018-02-20 20:18:05 -0500
committerMichael R Sweet <michael.r.sweet@gmail.com>2018-02-20 20:18:05 -0500
commita7aabde8fee21c62795eba831fc2bc965c6e0149 (patch)
tree2e9cc2b15c9dcde4b7eb88917f025ec8ec67221d /cups/http.c
parent699fe020752b0f0dbe1666117dd96791a98cc5a5 (diff)
downloadcups-a7aabde8fee21c62795eba831fc2bc965c6e0149.tar.gz
Setting the timeout should also timeout the TLS negotiation
(rdar://34938533)
Diffstat (limited to 'cups/http.c')
-rw-r--r--cups/http.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/cups/http.c b/cups/http.c
index 9af77c1c5..4d0a2a78e 100644
--- a/cups/http.c
+++ b/cups/http.c
@@ -4027,7 +4027,7 @@ http_read(http_t *http, /* I - HTTP connection */
DEBUG_printf(("http_read(http=%p, buffer=%p, length=" CUPS_LLFMT ")", (void *)http, (void *)buffer, CUPS_LLCAST length));
- if (!http->blocking)
+ if (!http->blocking || http->timeout_value > 0.0)
{
while (!httpWait(http, http->wait_value))
{
@@ -4626,7 +4626,7 @@ http_write(http_t *http, /* I - HTTP connection */
{
DEBUG_printf(("3http_write: About to write %d bytes.", (int)length));
- if (http->timeout_cb)
+ if (http->timeout_value > 0.0)
{
#ifdef HAVE_POLL
struct pollfd pfd; /* Polled file descriptor */
@@ -4670,7 +4670,7 @@ http_write(http_t *http, /* I - HTTP connection */
http->error = errno;
return (-1);
}
- else if (nfds == 0 && !(*http->timeout_cb)(http, http->timeout_data))
+ else if (nfds == 0 && (!http->timeout_cb || !(*http->timeout_cb)(http, http->timeout_data)))
{
#ifdef WIN32
http->error = WSAEWOULDBLOCK;