From f228370c3fc53617b151789cc000be5d73d24eec Mon Sep 17 00:00:00 2001
From: msweet
The scheduler sends SIGTERM
when a printing job is canceled or
held. Filters, backends, and port monitors must catch
diff --git a/cups/auth.c b/cups/auth.c
index 3cdb9b643..5a75d2b42 100644
--- a/cups/auth.c
+++ b/cups/auth.c
@@ -361,7 +361,7 @@ _cupsSetNegotiateAuthString(
snprintf(prompt, sizeof(prompt),
_cupsLangString(cg->lang_default, _("Password for %s on %s? ")),
- cupsUser(), http->gssname);
+ cupsUser(), http->gsshost);
if ((password = cupsGetPassword2(prompt, http, method, resource)) == NULL)
return (-1);
@@ -373,7 +373,7 @@ _cupsSetNegotiateAuthString(
username = cupsUser();
if (!strchr(username, '@'))
{
- snprintf(userbuf, sizeof(userbuf), "%s@%s", username, http->gssname);
+ snprintf(userbuf, sizeof(userbuf), "%s@%s", username, http->gsshost);
username = userbuf;
}
diff --git a/cups/file.c b/cups/file.c
index ab72a19f6..cd76dde14 100644
--- a/cups/file.c
+++ b/cups/file.c
@@ -89,7 +89,7 @@ _cupsFileCheck(
int dorootchecks, /* I - Check for root permissions? */
_cups_fc_func_t cb, /* I - Callback function */
void *context) /* I - Context pointer for callback */
-
+
{
struct stat fileinfo; /* File information */
char message[1024], /* Message string */
@@ -335,6 +335,7 @@ _cupsFileCheckFilter(
switch (result)
{
+ default :
case _CUPS_FILE_CHECK_OK :
prefix = "DEBUG2";
break;
diff --git a/cups/http-private.h b/cups/http-private.h
index 4f7daa070..56a9b7282 100644
--- a/cups/http-private.h
+++ b/cups/http-private.h
@@ -235,8 +235,6 @@ typedef void *http_tls_t;
typedef void *http_tls_credentials_t;
# endif /* HAVE_LIBSSL */
-typedef int (*_http_timeout_cb_t)(http_t *http, void *user_data);
-
struct _http_s /**** HTTP connection structure. ****/
{
int fd; /* File descriptor for this socket */
@@ -297,7 +295,7 @@ struct _http_s /**** HTTP connection structure. ****/
/**** New in CUPS 1.5 ****/
http_tls_credentials_t tls_credentials;
/* TLS credentials @since CUPS 1.5/Mac OS X 10.7@ */
- _http_timeout_cb_t timeout_cb; /* Timeout callback @since CUPS 1.5/Mac OS X 10.7@ */
+ http_timeout_cb_t timeout_cb; /* Timeout callback @since CUPS 1.5/Mac OS X 10.7@ */
void *timeout_data; /* User data pointer @since CUPS 1.5/Mac OS X 10.7@ */
struct timeval timeout_value; /* Timeout in seconds */
# ifdef HAVE_GSSAPI
@@ -390,8 +388,6 @@ extern const char *_httpResolveURI(const char *uri, char *resolved_uri,
size_t resolved_size, int options,
int (*cb)(void *context),
void *context);
-extern void _httpSetTimeout(http_t *http, double timeout,
- _http_timeout_cb_t cb, void *user_data);
extern int _httpUpdate(http_t *http, http_status_t *status);
extern int _httpWait(http_t *http, int msec, int usessl);
diff --git a/cups/http.c b/cups/http.c
index 53b1f1d66..50ebac357 100644
--- a/cups/http.c
+++ b/cups/http.c
@@ -80,7 +80,7 @@
* httpSetExpect() - Set the Expect: header in a request.
* httpSetField() - Set the value of an HTTP header.
* httpSetLength() - Set the content-length and content-encoding.
- * _httpSetTimeout() - Set read/write timeouts and an optional
+ * httpSetTimeout() - Set read/write timeouts and an optional
* callback.
* httpTrace() - Send an TRACE request to the server.
* _httpUpdate() - Update the current HTTP status for incoming
@@ -1314,8 +1314,11 @@ httpGets(char *line, /* I - Line to read into */
* No newline; see if there is more data to be read...
*/
- if (!_httpWait(http, http->blocking ? 30000 : 10000, 1))
+ while (!_httpWait(http, http->blocking ? 30000 : 10000, 1))
{
+ if (http->timeout_cb && (*http->timeout_cb)(http, http->timeout_data))
+ continue;
+
DEBUG_puts("3httpGets: Timed out!");
#ifdef WIN32
http->error = WSAETIMEDOUT;
@@ -1634,8 +1637,16 @@ _httpPeek(http_t *http, /* I - Connection to server */
* Buffer small reads for better performance...
*/
- if (!http->blocking && !httpWait(http, 10000))
- return (0);
+ if (!http->blocking)
+ {
+ while (!httpWait(http, 10000))
+ {
+ if (http->timeout_cb && (*http->timeout_cb)(http, http->timeout_data))
+ continue;
+
+ return (0);
+ }
+ }
if (http->data_remaining > sizeof(http->buffer))
bytes = sizeof(http->buffer);
@@ -1890,8 +1901,16 @@ httpRead2(http_t *http, /* I - Connection to server */
* Buffer small reads for better performance...
*/
- if (!http->blocking && !httpWait(http, 10000))
- return (0);
+ if (!http->blocking)
+ {
+ while (!httpWait(http, 10000))
+ {
+ if (http->timeout_cb && (*http->timeout_cb)(http, http->timeout_data))
+ continue;
+
+ return (0);
+ }
+ }
if (http->data_remaining > sizeof(http->buffer))
bytes = sizeof(http->buffer);
@@ -1978,16 +1997,32 @@ httpRead2(http_t *http, /* I - Connection to server */
#ifdef HAVE_SSL
else if (http->tls)
{
- if (!http->blocking && !httpWait(http, 10000))
- return (0);
+ if (!http->blocking)
+ {
+ while (!httpWait(http, 10000))
+ {
+ if (http->timeout_cb && (*http->timeout_cb)(http, http->timeout_data))
+ continue;
+
+ return (0);
+ }
+ }
bytes = (ssize_t)http_read_ssl(http, buffer, (int)length);
}
#endif /* HAVE_SSL */
else
{
- if (!http->blocking && !httpWait(http, 10000))
- return (0);
+ if (!http->blocking)
+ {
+ while (!httpWait(http, 10000))
+ {
+ if (http->timeout_cb && (*http->timeout_cb)(http, http->timeout_data))
+ continue;
+
+ return (0);
+ }
+ }
DEBUG_printf(("2httpRead2: reading " CUPS_LLFMT " bytes from socket...",
CUPS_LLCAST length));
@@ -2097,8 +2132,11 @@ _httpReadCDSA(
* Make sure we have data before we read...
*/
- if (!_httpWait(http, 10000, 0))
+ while (!_httpWait(http, 10000, 0))
{
+ if (http->timeout_cb && (*http->timeout_cb)(http, http->timeout_data))
+ continue;
+
http->error = ETIMEDOUT;
return (-1);
}
@@ -2158,8 +2196,11 @@ _httpReadGNUTLS(
* Make sure we have data before we read...
*/
- if (!_httpWait(http, 10000, 0))
+ while (!_httpWait(http, 10000, 0))
{
+ if (http->timeout_cb && (*http->timeout_cb)(http, http->timeout_data))
+ continue;
+
http->error = ETIMEDOUT;
return (-1);
}
@@ -2520,19 +2561,21 @@ httpSetLength(http_t *http, /* I - Connection to server */
/*
- * '_httpSetTimeout()' - Set read/write timeouts and an optional callback.
+ * 'httpSetTimeout()' - Set read/write timeouts and an optional callback.
*
* The optional timeout callback receives both the HTTP connection and a user
- * data pointer and must return 1 to continue or 0 to error out.
+ * data pointer and must return 1 to continue or 0 to error (time) out.
+ *
+ * @since CUPS 1.5/Mac OS X 10.7@
*/
void
-_httpSetTimeout(
- http_t *http, /* I - Connection to server */
- double timeout, /* I - Number of seconds for timeout,
+httpSetTimeout(
+ http_t *http, /* I - Connection to server */
+ double timeout, /* I - Number of seconds for timeout,
must be greater than 0 */
- _http_timeout_cb_t cb, /* I - Callback function or NULL */
- void *user_data) /* I - User data pointer */
+ http_timeout_cb_t cb, /* I - Callback function or NULL */
+ void *user_data) /* I - User data pointer */
{
if (!http || timeout <= 0.0)
return;
@@ -2553,6 +2596,7 @@ _httpSetTimeout(
sizeof(timeout_value));
setsockopt(http->fd, SOL_SOCKET, SO_SNDTIMEO, (char *)&timeout_value,
sizeof(timeout_value));
+
#else
setsockopt(http->fd, SOL_SOCKET, SO_RCVTIMEO, &(http->timeout_value),
sizeof(http->timeout_value));
@@ -3266,8 +3310,11 @@ http_bio_read(BIO *h, /* I - BIO data */
* Make sure we have data before we read...
*/
- if (!_httpWait(http, 10000, 0))
+ while (!_httpWait(http, 10000, 0))
{
+ if (http->timeout_cb && (*http->timeout_cb)(http, http->timeout_data))
+ continue;
+
#ifdef WIN32
http->error = WSAETIMEDOUT;
#else
diff --git a/cups/http.h b/cups/http.h
index 2c915e588..7e4eeb4a2 100644
--- a/cups/http.h
+++ b/cups/http.h
@@ -318,12 +318,16 @@ typedef struct http_addrlist_s /**** Socket address list, which is
typedef struct _http_s http_t; /**** HTTP connection type ****/
-typedef struct http_credential_s /**** Credential data @since CUPS 1.5/Mac OS X 10.7@ ****/
+typedef struct http_credential_s /**** HTTP credential data @since CUPS 1.5/Mac OS X 10.7@ ****/
{
void *data; /* Pointer to credential data */
size_t datalen; /* Credential length */
} http_credential_t;
+typedef int (*http_timeout_cb_t)(http_t *http, void *user_data);
+ /**** HTTP timeout callback @since CUPS 1.5/Mac OS X 10.7@ ****/
+
+
/*
* Prototypes...
@@ -447,7 +451,7 @@ extern char *httpGetAuthString(http_t *http) _CUPS_API_1_3;
extern void httpSetAuthString(http_t *http, const char *scheme,
const char *data) _CUPS_API_1_3;
-/**** New in CUPS 1.5 ****/
+/**** New in CUPS 1.5/Mac OS X 10.7 ****/
extern int httpAddCredential(cups_array_t *credentials,
const void *data, size_t datalen)
_CUPS_API_1_5;
@@ -457,6 +461,9 @@ extern int httpCopyCredentials(http_t *http,
extern void httpFreeCredentials(cups_array_t *certs) _CUPS_API_1_5;
extern int httpSetCredentials(http_t *http, cups_array_t *certs)
_CUPS_API_1_5;
+extern void httpSetTimeout(http_t *http, double timeout,
+ http_timeout_cb_t cb, void *user_data);
+
/*
* C++ magic...
diff --git a/cups/pwg-media.c b/cups/pwg-media.c
index 267e718a7..5c7ca2397 100644
--- a/cups/pwg-media.c
+++ b/cups/pwg-media.c
@@ -103,8 +103,8 @@ static _pwg_media_t const cups_pwg_media[] =
_PWG_MEDIA_IN("na_eur-edp_12x14in", NULL, NULL, 12, 14),
_PWG_MEDIA_IN("na_arch-b_12x18in", "arch-b", "ARCHB", 12, 18),
_PWG_MEDIA_IN("na_12x19_12x19in", NULL, "12x19", 12, 19),
- _PWG_MEDIA_IN("na_b-plus_12x19.17in", NULL, "SuperB", 12, 19.17),
- _PWG_MEDIA_IN("na_super-b_13x19in", "super-b", NULL, 13, 19),
+ _PWG_MEDIA_IN("na_b-plus_12x19.17in", NULL, NULL, 12, 19.17),
+ _PWG_MEDIA_IN("na_super-b_13x19in", "super-b", "SuperB", 13, 19),
_PWG_MEDIA_IN("na_c_17x22in", "c", "AnsiC", 17, 22),
_PWG_MEDIA_IN("na_arch-c_18x24in", "arch-c", "ARCHC", 18, 24),
_PWG_MEDIA_IN("na_d_22x34in", "d", "AnsiD", 22, 34),
@@ -226,6 +226,9 @@ static _pwg_media_t const cups_pwg_media[] =
_PWG_MEDIA_MM("om_dai-pa-kai_275x395mm", NULL, NULL, 275, 395),
_PWG_MEDIA_MM("prc_10_324x458mm", NULL, "EnvPRC10", 324, 458),
+ /* Other English Standard Sheet Media Sizes */
+ _PWG_MEDIA_IN("oe_photo-l_3.5x5in", NULL, "3.5x5", 3.5, 5),
+
/* Other Metric Standard Sheet Media Sizes */
_PWG_MEDIA_MM("om_small-photo_100x150mm", NULL, NULL, 100, 150),
_PWG_MEDIA_MM("om_italian_110x230mm", NULL, "EnvItalian", 110, 230),
diff --git a/data/media.defs b/data/media.defs
index 799e542d2..43b48c352 100644
--- a/data/media.defs
+++ b/data/media.defs
@@ -13,15 +13,18 @@
* file is missing or damaged, see the license at "http://www.cups.org/".
*/
-#media "10x11/10 x 11\"" 720 792
-#media "10x13/10 x 13\"" 720 936
-#media "10x14/10 x 14\"" 720 1008
-#media "12x11/12 x 11\"" 864 792
-#media "15x11/15 x 11\"" 1080 792
-#media "7x9/7 x 9\"" 504 648
-#media "8x10/8 x 10\"" 576 720
-#media "9x11/9 x 11\"" 648 792
-#media "9x12/9 x 12\"" 648 864
+#media "3x5/3 x 5" 216 360
+#media "3.5x5/3.5 x 5" 252 360
+#media "5x7/5 x 7" 360 504
+#media "10x11/10 x 11" 720 792
+#media "10x13/10 x 13" 720 936
+#media "10x14/10 x 14" 720 1008
+#media "12x11/12 x 11" 864 792
+#media "15x11/15 x 11" 1080 792
+#media "7x9/7 x 9" 504 648
+#media "8x10/8 x 10" 576 720
+#media "9x11/9 x 11" 648 792
+#media "9x12/9 x 12" 648 864
#media "A0/A0" 2384 3370
#media "A0.Transverse/A0 Long Edge" 3370 2384
#media "A1/A1" 1684 2384
diff --git a/doc/help/api-filter.html b/doc/help/api-filter.html
index c8fa766c4..4e18d2ef0 100644
--- a/doc/help/api-filter.html
+++ b/doc/help/api-filter.html
@@ -386,6 +386,7 @@ div.contents ul.subcontents li {
The scheduler sends SIGTERM
when a printing job is canceled or
held. Filters, backends, and port monitors must catch
diff --git a/doc/help/api-httpipp.html b/doc/help/api-httpipp.html
index 9793c9331..d540b8ed3 100644
--- a/doc/help/api-httpipp.html
+++ b/doc/help/api-httpipp.html
@@ -479,6 +479,7 @@ connection.">httpSetCredentials
Set read/write timeouts and an optional callback.
+
+void httpSetTimeout (
+ http_t *http,
+ double timeout,
+ http_timeout_cb_t cb,
+ void *user_data
+);
The optional timeout callback receives both the HTTP connection and a user +data pointer and must return 1 to continue or 0 to error (time) out. + +
Return a short string describing a HTTP status code.
@@ -3368,7 +3396,7 @@ typedef struct http_addrlist_s / http_addrlist_t; typedef enum http_auth_e http_auth_t;
Credential data
+HTTP credential data
typedef struct http_credential_s http_credential_t;
@@ -3408,6 +3436,11 @@ typedef enum http_status_e http_status_t;typedef struct _http_s http_t;
+HTTP timeout callback
++typedef int (*http_timeout_cb_t)(http_t *http, void *user_data); +
URI en/decode flags
@@ -3535,7 +3568,7 @@ with a hostname.
Credential data
+HTTP credential data
struct http_credential_s {
void *data;
size_t datalen;
diff --git a/doc/help/spec-ppd.html b/doc/help/spec-ppd.html
index c4c4bbef1..1b24af8d6 100644
--- a/doc/help/spec-ppd.html
+++ b/doc/help/spec-ppd.html
@@ -1647,11 +1647,7 @@ scheduler's DocumentRoot
directory, a full HTTP URL
valid URI which directs the user at additional information
concerning the condition that is being reported.
Since the reason text is limited to 80 characters by the PPD specification,
-longer text strings can be included by URI-encoding the text with the "text"
-scheme, for example "text:some%20text". Multiple text
URIs are
-combined (with spaces between each URI) by the ppdLocalizeIPPReason
-into a single string that can be displayed to the user.
Since the reason text is limited to 80 characters by the PPD specification, longer text strings can be included by URI-encoding the text with the "text" scheme, for example "text:some%20text". Multiple text
URIs are combined by the ppdLocalizeIPPReason into a single string that can be displayed to the user.
Examples:
diff --git a/doc/help/whatsnew.html b/doc/help/whatsnew.html index ea5898c0c..856f30a94 100644 --- a/doc/help/whatsnew.html +++ b/doc/help/whatsnew.html @@ -8,7 +8,7 @@CUPS 1.5 adds over ??? changes and new features to CUPS 1.4.x. This page provides a high-level outline of these changes. If you have never used CUPS before, read the "Overview of CUPS" document instead.
+CUPS 1.5 many changes and new features to CUPS 1.4.x. This page provides a high-level outline of these changes. If you have never used CUPS before, read the "Overview of CUPS" document instead.