All of lore.kernel.org
 help / color / mirror / Atom feed
* [Printing-architecture] Fix for STR #4187 incomplete, missing part attached
@ 2013-09-05 21:17 Till Kamppeter
  2013-09-09 14:40 ` Michael Sweet
  0 siblings, 1 reply; 4+ messages in thread
From: Till Kamppeter @ 2013-09-05 21:17 UTC (permalink / raw)
  To: Michael Sweet, Open Printing, Didier Raboud

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

Hi,

it seems that if a CUPS client (like the print dialog of LibreOffice)
stays connected to CUPS for a long time, the connection can get dropped
and the client does not reconnect.

This is handled by the following Ubuntu bug report:

https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/1020048

and also upstream by the following report in the former STR system:

http://www.cups.org/str.php?L4187

The STR was considered fixed by applying a patch, but the reporter of
the Ubuntu bug has found out that another patch is needed to complete
the fix. See comment #37 in the Ubuntu report:

https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/1020048/comments/37

The current CUPS 1.7.0rc1 has this "else" part but there is still
missing that "if" has also to close the connection when the result of
the recv() function is zero, meaning EOF, which happens when the server
terminates the connection.-

The attached patch adds this missing part.

In comment #44 of the Ubuntu report it is confirmed that this missing
piece applied fixes the problem completely:

https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/1020048/comments/44

Can you apply this patch to the final CUPS 1.7.0? Thanks.

   Till


[-- Attachment #2: handle-server-terminating-connection.patch --]
[-- Type: text/x-patch, Size: 643 bytes --]

--- a/cups/request.c
+++ b/cups/request.c
@@ -1018,13 +1018,14 @@
       */
 
       char ch;				/* Connection check byte */
+      int n;
 
 #ifdef WIN32
-      if (recv(cg->http->fd, &ch, 1, MSG_PEEK) < 0 &&
-          WSAGetLastError() != WSAEWOULDBLOCK)
+      if ((n = recv(cg->http->fd, &ch, 1, MSG_PEEK) == 0) ||
+          (n < 0 && WSAGetLastError() != WSAEWOULDBLOCK))
 #else
-      if (recv(cg->http->fd, &ch, 1, MSG_PEEK | MSG_DONTWAIT) < 0 &&
-          errno != EWOULDBLOCK)
+      if ((n = recv(cg->http->fd, &ch, 1, MSG_PEEK | MSG_DONTWAIT) == 0) ||
+	  (n < 0 && errno != EWOULDBLOCK))
 #endif /* WIN32 */
       {
        /*

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Printing-architecture] Fix for STR #4187 incomplete, missing part attached
  2013-09-05 21:17 [Printing-architecture] Fix for STR #4187 incomplete, missing part attached Till Kamppeter
@ 2013-09-09 14:40 ` Michael Sweet
  2013-09-09 19:48   ` Till Kamppeter
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Sweet @ 2013-09-09 14:40 UTC (permalink / raw)
  To: Till Kamppeter; +Cc: printing-architecture, Didier Raboud

Till,

This is already fixed for <rdar://problem/14484313>, which was created in response to the bug below back in July.  The 1.6.4 and 1.7.0 releases that are queued up both contain the fix.

(and FWIW, "n" needs to be ssize_t, not int...)


On Sep 5, 2013, at 5:17 PM, Till Kamppeter <till.kamppeter@gmail.com> wrote:

> Hi,
> 
> it seems that if a CUPS client (like the print dialog of LibreOffice)
> stays connected to CUPS for a long time, the connection can get dropped
> and the client does not reconnect.
> 
> This is handled by the following Ubuntu bug report:
> 
> https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/1020048
> 
> and also upstream by the following report in the former STR system:
> 
> http://www.cups.org/str.php?L4187
> 
> The STR was considered fixed by applying a patch, but the reporter of
> the Ubuntu bug has found out that another patch is needed to complete
> the fix. See comment #37 in the Ubuntu report:
> 
> https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/1020048/comments/37
> 
> The current CUPS 1.7.0rc1 has this "else" part but there is still
> missing that "if" has also to close the connection when the result of
> the recv() function is zero, meaning EOF, which happens when the server
> terminates the connection.-
> 
> The attached patch adds this missing part.
> 
> In comment #44 of the Ubuntu report it is confirmed that this missing
> piece applied fixes the problem completely:
> 
> https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/1020048/comments/44
> 
> Can you apply this patch to the final CUPS 1.7.0? Thanks.
> 
>   Till
> 
> <handle-server-terminating-connection.patch>

_________________________________________________________
Michael Sweet, Senior Printing System Engineer, PWG Chair


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Printing-architecture] Fix for STR #4187 incomplete, missing part attached
  2013-09-09 14:40 ` Michael Sweet
@ 2013-09-09 19:48   ` Till Kamppeter
  2013-09-09 20:49     ` Michael Sweet
  0 siblings, 1 reply; 4+ messages in thread
From: Till Kamppeter @ 2013-09-09 19:48 UTC (permalink / raw)
  To: Michael Sweet; +Cc: printing-architecture, Didier Raboud

On 09/09/2013 04:40 PM, Michael Sweet wrote:
> Till,
> 
> This is already fixed for <rdar://problem/14484313>, which was created in response to the bug below back in July.  The 1.6.4 and 1.7.0 releases that are queued up both contain the fix.
> 
> (and FWIW, "n" needs to be ssize_t, not int...)

Thank you very much, Then I know that I can remove the patch when
switching to 1.7.0 final.

By the way, when do you plan to put out 1.7.0 and what are the show
stoppers still preventing you from putting it out?

   Till



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Printing-architecture] Fix for STR #4187 incomplete, missing part attached
  2013-09-09 19:48   ` Till Kamppeter
@ 2013-09-09 20:49     ` Michael Sweet
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Sweet @ 2013-09-09 20:49 UTC (permalink / raw)
  To: Till Kamppeter; +Cc: printing-architecture, Didier Raboud

Till,

On Sep 9, 2013, at 3:48 PM, Till Kamppeter <till.kamppeter@gmail.com> wrote:
> On 09/09/2013 04:40 PM, Michael Sweet wrote:
>> Till,
>> 
>> This is already fixed for <rdar://problem/14484313>, which was created in response to the bug below back in July.  The 1.6.4 and 1.7.0 releases that are queued up both contain the fix.
>> 
>> (and FWIW, "n" needs to be ssize_t, not int...)
> 
> Thank you very much, Then I know that I can remove the patch when
> switching to 1.7.0 final.
> 
> By the way, when do you plan to put out 1.7.0 and what are the show
> stoppers still preventing you from putting it out?

1.7.0 is tied to the release of OS X 10.9 (nothing I can do about that, sorry...)  Once 10.9 is out I'll be able to do periodic 1.7.x releases separate from the 10.9.x releases (no more ties for the patch updates...)

(and yes, I did not say when 1.7.0/10.9 is coming out on purpose...)

_________________________________________________________
Michael Sweet, Senior Printing System Engineer, PWG Chair


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-09-09 20:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-05 21:17 [Printing-architecture] Fix for STR #4187 incomplete, missing part attached Till Kamppeter
2013-09-09 14:40 ` Michael Sweet
2013-09-09 19:48   ` Till Kamppeter
2013-09-09 20:49     ` Michael Sweet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.