Bugzilla – Attachment 71432 Details for
Bug 56344
CUPS timeout and automatic reconnect
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Force reconnection to CUPS server on print failure
lo-cups-reconnect.patch (text/plain), 1.59 KB, created by
Alex Prokofiev
on 2012-12-13 08:22:03 UTC
(
hide
)
Description:
Force reconnection to CUPS server on print failure
Filename:
MIME Type:
Creator:
Alex Prokofiev
Created:
2012-12-13 08:22:03 UTC
Size:
1.59 KB
patch
obsolete
>--- vcl/unx/generic/printer/cupsmgr.cxx.orig 2012-09-25 16:13:30.000000000 +0400 >+++ vcl/unx/generic/printer/cupsmgr.cxx 2012-12-13 12:12:52.686296375 +0400 >@@ -73,6 +73,7 @@ > const char* (*m_pcupsUser)(); > void (*m_pcupsSetUser)(const char*); > const char* (*m_pcupsGetOption)(const char*,int,cups_option_t*); >+ void (*m_pcupsSetServer)(const char*); > > oslGenericFunction loadSymbol( const char* ); > public: >@@ -95,7 +96,19 @@ > const char* pTitle, > int nOptions, > cups_option_t* pOptions ) >- { return m_pcupsPrintFile( pPrinter, pFileName, pTitle, nOptions, pOptions ); } >+ { >+ int job_id = m_pcupsPrintFile( pPrinter, pFileName, pTitle, nOptions, pOptions ); >+ if (job_id == 0 && m_pcupsSetServer != NULL) { >+ /* >+ * Fail could be due to expired HTTP connection >+ * calling SetServer resets internal connection, so that next CUPS call reconnects >+ */ >+ m_pcupsSetServer(NULL); >+ job_id = m_pcupsPrintFile( pPrinter, pFileName, pTitle, nOptions, pOptions ); >+ // fprintf(stderr, "-- cupsPrintFile: retry rc=%i\n", job_id); >+ } >+ return job_id; >+ } > > rtl::OString cupsGetPPD( const char* pPrinter ); > >@@ -226,6 +239,8 @@ > loadSymbol( "cupsSetUser" ); > m_pcupsGetOption = (const char*(*)(const char*,int,cups_option_t*)) > loadSymbol( "cupsGetOption" ); >+ m_pcupsSetServer = (void(*)(const char*)) >+ loadSymbol( "cupsSetServer" ); > > if( ! ( > m_pcupsPrintFile &&
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 56344
: 71432