* report_attr() - Report an IPP attribute value.
* report_printer_state() - Report the printer state.
* run_as_user() - Run the IPP backend as the printing user.
+ * timeout_cb() - Handle HTTP timeouts.
* sigterm_handler() - Handle 'terminate' signals that stop the backend.
*/
const char *device_uri, int fd);
#endif /* HAVE_GSSAPI && HAVE_XPC */
static void sigterm_handler(int sig);
+static int timeout_cb(http_t *http, void *user_data);
static void update_reasons(ipp_attribute_t *attr, const char *s);
if (argc == 6)
{
num_files = 0;
+ files = NULL;
send_options = !_cups_strcasecmp(final_content_type, "application/pdf") ||
!_cups_strcasecmp(final_content_type, "application/vnd.cups-pdf") ||
!_cups_strncasecmp(final_content_type, "image/", 6);
}
http = _httpCreate(hostname, port, addrlist, cupsEncryption(), AF_UNSPEC);
+ httpSetTimeout(http, 30.0, timeout_cb, NULL);
/*
* See if the printer supports SNMP...
http = _httpCreate(monitor->hostname, monitor->port, NULL, monitor->encryption,
AF_UNSPEC);
+ httpSetTimeout(http, 30.0, timeout_cb, NULL);
cupsSetPasswordCB(password_cb);
/*
}
+/*
+ * 'timeout_cb()' - Handle HTTP timeouts.
+ */
+
+static int /* O - 1 to continue, 0 to cancel */
+timeout_cb(http_t *http, /* I - Connection to server (unused) */
+ void *user_data) /* I - User data (unused) */
+{
+ (void)http;
+ (void)user_data;
+
+ return (!job_canceled);
+}
+
+
/*
* 'update_reasons()' - Update the printer-state-reasons values.
*/