Date: Sun, 26 May 2013 09:21:56 GMT From: "r4721@tormail.org" <r4721@tormail.org> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/178987: [patch] fix printing failure in print/cups-client Message-ID: <201305260921.r4Q9Luxi030691@oldred.FreeBSD.org> Resent-Message-ID: <201305260930.r4Q9U1rt011025@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 178987 >Category: ports >Synopsis: [patch] fix printing failure in print/cups-client >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun May 26 09:30:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: r4721@tormail.org >Release: >Organization: >Environment: >Description: when a connection to the print server is established over tcp and times out after 5 minutes of inactivity, printing after this will silently fail. most applications only initiate the connection when the print dialog is opened, but libreoffice opens it on startup so it is most noticable there as a failure to print after it has been open for > 5 minutes without printing. new file: print/cups-base/files/patch-client-reconnect this is a backported patch from cups 1.6 which fixes the issue. it should be deleted once the port is updated to 1.6. >How-To-Repeat: >Fix: Patch attached with submission follows: Index: print/cups-base/files/patch-client-reconnect =================================================================== --- print/cups-base/files/patch-client-reconnect (revision 0) +++ print/cups-base/files/patch-client-reconnect (working copy) @@ -0,0 +1,28 @@ +--- cups/request.c ++++ cups/request.c +@@ -1004,6 +1004,25 @@ + httpClose(cg->http); + cg->http = NULL; + } ++ else ++ { ++ /* ++ * Same server, see if the connection is still established... ++ */ ++ ++ char ch; /* Connection check byte */ ++ ++ if (recv(cg->http->fd, &ch, 1, MSG_PEEK | MSG_DONTWAIT) < 0 && ++ errno != EWOULDBLOCK) ++ { ++ /* ++ * Nope, close the connection... ++ */ ++ ++ httpClose(cg->http); ++ cg->http = NULL; ++ } ++ } + } + + /* >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201305260921.r4Q9Luxi030691>