-CHANGES-IPPTOOL.txt - 2013-05-02
+CHANGES-IPPTOOL.txt - 2013-05-29
--------------------------------
This file provides a list of changes to the ipptool binary distribution posted
on cups.org.
-2013-05-02
+2013-05-29
+ - Added support for automatically extending the timeout when all of the
+ request data has not yet been written (all platforms but Windows
+ which does not support it...)
- Fixed several ipptool test files that used old STATUS names.
CHANGES IN CUPS V1.7b2
+ - The ipptool program now automatically extends timeouts when the
+ output buffer is filled (<rdar://problem/14016099>)
- The ipptool program now supports the --help and --version options.
- The ipptool program did not continue past include file errors by
default (<rdar://problem/13875803>)
*/
static int /* O - 1 to continue, 0 to cancel */
-timeout_cb(http_t *http, /* I - Connection to server (unused) */
+timeout_cb(http_t *http, /* I - Connection to server */
void *user_data) /* I - User data (unused) */
{
+ int buffered = 0; /* Bytes buffered but not yet sent */
+
+
+ /*
+ * If the socket still have data waiting to be sent to the printer (as can
+ * happen if the printer runs out of paper), continue to wait until the output
+ * buffer is empty...
+ */
+
+#ifdef SO_NWRITE /* OS X and some versions of Linux */
+ socklen_t len = sizeof(buffered); /* Size of return value */
+
+ if (getsockopt(httpGetFd(http), SOL_SOCKET, SO_NWRITE, &buffered, &len))
+ buffered = 0;
+
+#elif defined(SIOCOUTQ) /* Others except Windows */
+ if (ioctl(httpGetFd(http), SIOCOUTQ, &buffered))
+ buffered = 0;
+
+#else /* Windows (not possible) */
(void)http;
(void)user_data;
+#endif /* SO_NWRITE */
- /* Always cancel on timeout */
- return (0);
+ return (buffered > 0);
}