7187280 Printer dialog print list is empty when printing concurrent jobs s11u1-sru S11.1SRU1_04
authorPetr Cvachoucek <petr.cvachoucek@oracle.com>
Fri, 26 Oct 2012 00:16:37 -0700
branchs11u1-sru
changeset 2410 0f7f40aad86a
parent 2406 2652490f32cd
child 2415 db591cab6e24
7187280 Printer dialog print list is empty when printing concurrent jobs
components/cups/patches/7187280.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/cups/patches/7187280.patch	Fri Oct 26 00:16:37 2012 -0700
@@ -0,0 +1,51 @@
+--- cups/util.c	Mon Jan 19 23:26:36 1970
++++ cups/util.c	Mon Jan 19 23:26:36 1970
[email protected]@ -70,6 +70,9 @@
+ #  include <unistd.h>
+ #endif /* WIN32 || __EMX__ */
+ 
++#if defined(__sun)
++#include <inet/tcp.h>		/* need this for TCPS_ESTABLISHED ... */
++#endif
+ 
+ /*
+  * Local functions...
[email protected]@ -1659,6 +1662,38 @@
+       cg->http = NULL;
+     }
+   }
++
++#if defined(__sun)
++ /*
++  * Check the connection state.
++  * If the connection wasn't used for some time, the server could close it.
++  * The socket state would change to CLOSE_WAIT in such case.
++  */
++  if (cg->http)
++  {
++    struct tcp_info tcpi;
++    socklen_t len = sizeof(tcpi);
++    memset(&tcpi, 0, sizeof(tcpi));
++
++   /*
++    * Get TCP connection info.
++    */
++    if (getsockopt(cg->http->fd, IPPROTO_TCP, TCP_INFO, &tcpi, &len) == 0)
++    {
++     /*
++      * Successfully got TCP connection state. Check it.
++      */
++      if (tcpi.tcpi_state != TCPS_ESTABLISHED)
++      {
++       /*
++        * Need to close the current connection.
++        */
++        httpClose(cg->http);
++        cg->http = NULL;
++      }
++    }
++  }
++#endif
+ 
+  /*
+   * (Re)connect as needed...