~ubuntu-branches/ubuntu/jaunty/cups/jaunty

« back to all changes in this revision

Viewing changes to debian/patches/client-ssl-hang.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt, Till Kamppeter, Martin Pitt
  • Date: 2009-02-15 18:39:03 UTC
  • mfrom: (6.1.30 jaunty)
  • Revision ID: james.westby@ubuntu.com-20090215183903-i0nhvqyqj4vyn52a
Tags: 1.3.9-13
[ Till Kamppeter ]
* debian/local/filters/pdf-filters/filter/imagetopdf.c: Added support for
  the new "fit-to-page" option (new, more intuitive name for "fitplot").
* debian/filters/pstopdf: Only apply paper size if the "fitplot" or the
  "fit-to-page" option is set.
* debian/local/filters/cpdftocps: Only the last digit of the number of
  copies was used (LP: #309314).
* debian/local/filters/pdf-filters/pdftopdf/pdftopdf.cxx: Do not preceed the
  PDF output with a newline (LP: #303691). Only impose the page size from
  the PPD file to all pages if the "fitplot" or the "fit-to-page" option is 
  set. This prevented from automatic paper tray switching to the correct paper
  sizes when a multiple-page-size document is printed (partial fix for
  LP: #310575).
* debian/patches/pdftops-cups-1.4.dpatch: Updated from CUPS 1.4 SVN. Contains
  fixes for multiple-page-size document printing (partial fix for
  LP: #310575).
* debian/patches/pdftops-dont_fail_on_cancel.dpatch: Removed, should be
  fixed in the new upstream version of pdftops.

[ Martin Pitt ]
* debian/patches/pdftops-cups-1.4.dpatch: Add definition of
  HAVE_PDFTOPS and CUPS_PDFTOPS, so that the filter actually gets
  again built with pdftops support. (Fixes Till's change from above).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh /usr/share/dpatch/dpatch-run
2
 
##
3
 
## DP: Fix client loop for SSL connections.
4
 
 
5
 
--- a/scheduler/client.c        (revision 7820)
6
 
+++ b/scheduler/client.c        (working copy)
7
 
@@ -28,6 +28,7 @@
8
 
  *   cupsdUpdateCGI()        - Read status messages from CGI scripts and programs.
9
 
  *   cupsdWriteClient()      - Write data to a client as needed.
10
 
  *   check_if_modified()     - Decode an "If-Modified-Since" line.
11
 
+ *   data_ready()            - Check whether data is available from a client.
12
 
  *   encrypt_client()        - Enable encryption for the client...
13
 
  *   get_cdsa_certificate()  - Convert a keychain name into the CFArrayRef
14
 
  *                            required by SSLSetCertificate.
15
 
@@ -83,6 +84,7 @@
16
 
 
17
 
 static int             check_if_modified(cupsd_client_t *con,
18
 
                                          struct stat *filestats);
19
 
+static int             data_ready(cupsd_client_t *con);
20
 
 #ifdef HAVE_SSL
21
 
 static int             encrypt_client(cupsd_client_t *con);
22
 
 #endif /* HAVE_SSL */
23
 
@@ -989,8 +991,7 @@
24
 
        */
25
 
 
26
 
         while ((status = httpUpdate(HTTP(con))) == HTTP_CONTINUE)
27
 
-         if (con->http.used == 0 ||
28
 
-             !memchr(con->http.buffer, '\n', con->http.used))
29
 
+         if (!data_ready(con))
30
 
            break;
31
 
 
32
 
        if (status != HTTP_OK && status != HTTP_CONTINUE)
33
 
@@ -1889,7 +1890,7 @@
34
 
            }
35
 
          }
36
 
         }
37
 
-       while (con->http.state == HTTP_PUT_RECV && con->http.used > 0);
38
 
+       while (con->http.state == HTTP_PUT_RECV && data_ready(con));
39
 
 
40
 
         if (con->http.state == HTTP_WAITING)
41
 
        {
42
 
@@ -2064,7 +2065,7 @@
43
 
            }
44
 
          }
45
 
         }
46
 
-       while (con->http.state == HTTP_POST_RECV && con->http.used > 0);
47
 
+       while (con->http.state == HTTP_POST_RECV && data_ready(con));
48
 
 
49
 
        if (con->http.state == HTTP_POST_SEND)
50
 
        {
51
 
@@ -2914,7 +2915,39 @@
52
 
 }
53
 
 
54
 
 
55
 
+/*
56
 
+ * 'data_ready()' - Check whether data is available from a client.
57
 
+ */
58
 
+
59
 
+static int                             /* O - 1 if data is ready, 0 otherwise */
60
 
+data_ready(cupsd_client_t *con)                /* I - Client */
61
 
+{
62
 
+  if (con->http.used > 0)
63
 
+    return (1);
64
 
 #ifdef HAVE_SSL
65
 
+  else if (con->http.tls)
66
 
+  {
67
 
+#  ifdef HAVE_LIBSSL
68
 
+    if (SSL_pending((SSL *)(con->http.tls)))
69
 
+      return (1);
70
 
+#  elif defined(HAVE_GNUTLS)
71
 
+    if (gnutls_record_check_pending(((http_tls_t *)(con->http.tls))->session))
72
 
+      return (1);
73
 
+#  elif defined(HAVE_CDSASSL)
74
 
+    size_t bytes;                      /* Bytes that are available */
75
 
+
76
 
+    if (!SSLGetBufferedReadSize(((http_tls_t *)(con->http.tls))->session,
77
 
+                                &bytes) && bytes > 0)
78
 
+      return (1);
79
 
+#  endif /* HAVE_LIBSSL */
80
 
+  }
81
 
+#endif /* HAVE_SSL */
82
 
+
83
 
+  return (0);
84
 
+}
85
 
+
86
 
+
87
 
+#ifdef HAVE_SSL
88
 
 /*
89
 
  * 'encrypt_client()' - Enable encryption for the client...
90
 
  */