Blob Blame History Raw
From da49acb6cd1f37b03b9f7144e297414996808fd9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Fri, 22 Jan 2016 10:52:19 +0000
Subject: [PATCH] Resolves: rhbz#1257635 after httpConnectEncrypt use
 cupsGetDests2

sometimes after calling httpConnectEncrypt + httpClose and then
calling cupsGetDests we get no printers found. Using
cupsGetDests2 with the return of httpConnectEncrypt consistently
provides results.

Change-Id: I7ea5b11fbaabbd7ca73e5c94d0757ebdea8445ad
---
 vcl/unx/generic/printer/cupsmgr.cxx | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/vcl/unx/generic/printer/cupsmgr.cxx b/vcl/unx/generic/printer/cupsmgr.cxx
index 5c47442..b46b299 100644
--- a/vcl/unx/generic/printer/cupsmgr.cxx
+++ b/vcl/unx/generic/printer/cupsmgr.cxx
@@ -220,10 +220,7 @@ void CUPSManager::runDests()
              ippPort(),
              cupsEncryption())) != nullptr )
     {
-        // neat, cups is up, clean up the canary
-        httpClose(p_http);
-
-        int nDests = cupsGetDests( &pDests );
+        int nDests = cupsGetDests2(p_http,  &pDests);
         SAL_INFO("vcl.unx.print", "came out of cupsGetDests");
 
         osl::MutexGuard aGuard( m_aCUPSMutex );
@@ -231,6 +228,8 @@ void CUPSManager::runDests()
         m_pDests = pDests;
         m_bNewDests = true;
         SAL_INFO("vcl.unx.print", "finished cupsGetDests");
+
+        httpClose(p_http);
     }
 }
 
-- 
2.5.0