- Applied patch to fix STR #2892 (bug #453610).

This commit is contained in:
Tim Waugh 2008-08-03 13:31:08 +00:00
parent e00ae0ba56
commit 89895fb4b4
2 changed files with 92 additions and 1 deletions

86
cups-str2892.patch Normal file
View File

@ -0,0 +1,86 @@
diff -up cups-1.3.8/scheduler/client.c.str2892 cups-1.3.8/scheduler/client.c
--- cups-1.3.8/scheduler/client.c.str2892 2008-07-11 23:48:49.000000000 +0100
+++ cups-1.3.8/scheduler/client.c 2008-08-03 11:42:35.000000000 +0100
@@ -28,6 +28,7 @@
* cupsdUpdateCGI() - Read status messages from CGI scripts and programs.
* cupsdWriteClient() - Write data to a client as needed.
* check_if_modified() - Decode an "If-Modified-Since" line.
+ * data_ready() - Check whether data is available from a client.
* encrypt_client() - Enable encryption for the client...
* get_cdsa_certificate() - Convert a keychain name into the CFArrayRef
* required by SSLSetCertificate.
@@ -83,6 +84,7 @@ extern const char *cssmErrorString(int e
static int check_if_modified(cupsd_client_t *con,
struct stat *filestats);
+static int data_ready(cupsd_client_t *con);
#ifdef HAVE_SSL
static int encrypt_client(cupsd_client_t *con);
#endif /* HAVE_SSL */
@@ -989,8 +991,7 @@ cupsdReadClient(cupsd_client_t *con) /*
*/
while ((status = httpUpdate(HTTP(con))) == HTTP_CONTINUE)
- if (con->http.used == 0 ||
- !memchr(con->http.buffer, '\n', con->http.used))
+ if (!data_ready(con))
break;
if (status != HTTP_OK && status != HTTP_CONTINUE)
@@ -1889,7 +1890,7 @@ cupsdReadClient(cupsd_client_t *con) /*
}
}
}
- while (con->http.state == HTTP_PUT_RECV && con->http.used > 0);
+ while (con->http.state == HTTP_PUT_RECV && data_ready(con));
if (con->http.state == HTTP_WAITING)
{
@@ -2064,7 +2065,7 @@ cupsdReadClient(cupsd_client_t *con) /*
}
}
}
- while (con->http.state == HTTP_POST_RECV && con->http.used > 0);
+ while (con->http.state == HTTP_POST_RECV && data_ready(con));
if (con->http.state == HTTP_POST_SEND)
{
@@ -2914,6 +2915,38 @@ check_if_modified(
}
+/*
+ * 'data_ready()' - Check whether data is available from a client.
+ */
+
+static int /* O - 1 if data is ready, 0 otherwise */
+data_ready(cupsd_client_t *con) /* I - Client */
+{
+ if (con->http.used > 0)
+ return (1);
+#ifdef HAVE_SSL
+ else if (con->http.tls)
+ {
+# ifdef HAVE_LIBSSL
+ if (SSL_pending((SSL *)(con->http.tls)))
+ return (1);
+# elif defined(HAVE_GNUTLS)
+ if (gnutls_record_check_pending(((http_tls_t *)(con->http.tls))->session))
+ return (1);
+# elif defined(HAVE_CDSASSL)
+ size_t bytes; /* Bytes that are available */
+
+ if (!SSLGetBufferedReadSize(((http_tls_t *)(con->http.tls))->session,
+ &bytes) && bytes > 0)
+ return (1);
+# endif /* HAVE_LIBSSL */
+ }
+#endif /* HAVE_SSL */
+
+ return (0);
+}
+
+
#ifdef HAVE_SSL
/*
* 'encrypt_client()' - Enable encryption for the client...

View File

@ -7,7 +7,7 @@
Summary: Common Unix Printing System Summary: Common Unix Printing System
Name: cups Name: cups
Version: 1.3.8 Version: 1.3.8
Release: 1%{?svn:.svn%{svn}}%{?dist} Release: 2%{?svn:.svn%{svn}}%{?dist}
License: GPLv2 License: GPLv2
Group: System Environment/Daemons Group: System Environment/Daemons
Source: ftp://ftp.easysw.com/pub/cups/test//cups-%{version}%{?svn:svn-r%{svn}}-source.tar.bz2 Source: ftp://ftp.easysw.com/pub/cups/test//cups-%{version}%{?svn:svn-r%{svn}}-source.tar.bz2
@ -47,6 +47,7 @@ Patch19: cups-strict-ppd-line-length.patch
Patch20: cups-logrotate.patch Patch20: cups-logrotate.patch
Patch21: cups-usb-paperout.patch Patch21: cups-usb-paperout.patch
Patch22: cups-getnameddest.patch Patch22: cups-getnameddest.patch
Patch23: cups-str2892.patch
Patch100: cups-lspp.patch Patch100: cups-lspp.patch
Epoch: 1 Epoch: 1
Url: http://www.cups.org/ Url: http://www.cups.org/
@ -168,6 +169,7 @@ lpd emulation.
%patch20 -p1 -b .logrotate %patch20 -p1 -b .logrotate
%patch21 -p1 -b .usb-paperout %patch21 -p1 -b .usb-paperout
%patch22 -p1 -b .getnameddest %patch22 -p1 -b .getnameddest
%patch23 -p1 -b .str2892
%if %lspp %if %lspp
%patch100 -p1 -b .lspp %patch100 -p1 -b .lspp
@ -442,6 +444,9 @@ rm -rf $RPM_BUILD_ROOT
%{cups_serverbin}/daemon/cups-lpd %{cups_serverbin}/daemon/cups-lpd
%changelog %changelog
* Sun Aug 3 2008 Tim Waugh <twaugh@redhat.com> 1:1.3.8-2
- Applied patch to fix STR #2892 (bug #453610).
* Mon Jul 28 2008 Tim Waugh <twaugh@redhat.com> 1:1.3.8-1 * Mon Jul 28 2008 Tim Waugh <twaugh@redhat.com> 1:1.3.8-1
- 1.3.8. - 1.3.8.