From: msweet Date: Sun, 1 Feb 2015 04:50:11 +0000 (+0000) Subject: The ipptool timeout option did not work (STR #4515) X-Git-Tag: v2.2b1~362 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba7900a5298b90edccb8d2cc6afa16b130d6a2d0;p=thirdparty%2Fcups.git The ipptool timeout option did not work (STR #4515) git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12466 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/CHANGES-2.0.txt b/CHANGES-2.0.txt index 2202d75451..c6f427bd11 100644 --- a/CHANGES-2.0.txt +++ b/CHANGES-2.0.txt @@ -36,6 +36,7 @@ CHANGES IN CUPS V2.0.2 error (STR #4559) - The ippfind and ipptool programs now correctly match hostnames with trailing dots (STR #4563) + - The ipptool timeout option did not work (STR #4515) CHANGES IN CUPS V2.0.1 diff --git a/cups/ipp.c b/cups/ipp.c index 20bd320f94..2536693dab 100644 --- a/cups/ipp.c +++ b/cups/ipp.c @@ -6830,6 +6830,22 @@ ipp_read_http(http_t *http, /* I - Client connection */ break; } } + else if (http->used == 0 && http->timeout_value > 0) + { + /* + * Wait up to timeout seconds for more data on blocking sockets... + */ + + if (!httpWait(http, (int)(1000 * http->timeout_value))) + { + /* + * Signal no data... + */ + + bytes = -1; + break; + } + } if ((bytes = httpRead2(http, (char *)buffer, length - (size_t)tbytes)) < 0) {