Index: gtk/gtkprinter.c
===================================================================
--- gtk/gtkprinter.c	(revision 21195)
+++ gtk/gtkprinter.c	(working copy)
@@ -1201,9 +1201,9 @@
     {
       printer_list->loop = g_main_loop_new (NULL, FALSE);
 
+      GDK_THREADS_ENTER ();  
+      g_main_loop_run (printer_list->loop);
       GDK_THREADS_LEAVE ();  
-      g_main_loop_run (printer_list->loop);
-      GDK_THREADS_ENTER ();  
     }
 }
 
Index: modules/printbackends/cups/gtkcupsutils.c
===================================================================
--- modules/printbackends/cups/gtkcupsutils.c	(revision 21195)
+++ modules/printbackends/cups/gtkcupsutils.c	(working copy)
@@ -1220,9 +1220,9 @@
 
   result->socket = -1;
   result->current_addr = NULL;
-  result->success_at_init = FALSE;
+  result->at_init = GTK_CUPS_CONNECTION_NOT_AVAILABLE;
 
-  result->success_at_init = gtk_cups_connection_test_is_server_available (result);
+  result->at_init = gtk_cups_connection_test_is_server_available (result);
 #else
   result = g_new (GtkCupsConnectionTest, 1);
 #endif
@@ -1236,22 +1236,23 @@
  *  - you need to check it more then once.
  * The connection is closed after a successful connection.
  */
-gboolean 
+GtkCupsConnectionState 
 gtk_cups_connection_test_is_server_available (GtkCupsConnectionTest *test)
 {
 #ifdef HAVE_CUPS_API_1_2
-  http_addrlist_t *iter;
-  gboolean         result = FALSE;
-  gint             flags;
-  gint             code;
+  GtkCupsConnectionState result = GTK_CUPS_CONNECTION_NOT_AVAILABLE;
+  http_addrlist_t       *iter;
+  gint                   error_code;
+  gint                   flags;
+  gint                   code;
 
   if (test == NULL)
-    return FALSE;
+    return GTK_CUPS_CONNECTION_NOT_AVAILABLE;
 
-  if (test->success_at_init)
+  if (test->at_init == GTK_CUPS_CONNECTION_AVAILABLE)
     {
-      test->success_at_init = FALSE;
-      return TRUE;
+      test->at_init = GTK_CUPS_CONNECTION_NOT_AVAILABLE;
+      return GTK_CUPS_CONNECTION_AVAILABLE;
     }
   else
     {
@@ -1287,21 +1288,28 @@
                           &test->current_addr->addr.addr,
                           httpAddrLength (&test->current_addr->addr));
 
+          error_code = errno;
+
           if (code == 0)
             {
               close (test->socket);
               test->socket = -1;
               test->current_addr = NULL;
-              result = TRUE;
+              result = GTK_CUPS_CONNECTION_AVAILABLE;
             }
           else
-            result = FALSE;
+            {
+              if (error_code == EALREADY || error_code == EINPROGRESS)
+                result = GTK_CUPS_CONNECTION_IN_PROGRESS;
+              else
+                result = GTK_CUPS_CONNECTION_NOT_AVAILABLE;
+            }
          }
 
       return result;
     }
 #else
-  return TRUE;
+  return GTK_CUPS_CONNECTION_AVAILABLE;
 #endif
 }
 
Index: modules/printbackends/cups/gtkprintbackendcups.c
===================================================================
--- modules/printbackends/cups/gtkprintbackendcups.c	(revision 21195)
+++ modules/printbackends/cups/gtkprintbackendcups.c	(working copy)
@@ -108,6 +108,7 @@
   guint got_default_printer   : 1;
   guint default_printer_poll;
   GtkCupsConnectionTest *default_printer_connection_test;
+  GtkCupsConnectionTest *printer_list_connection_test;
 
   char **covers;
   char  *default_cover_before;
@@ -514,6 +515,7 @@
 
   backend_cups->default_printer_poll = 0;
   backend_cups->default_printer_connection_test = NULL;
+  backend_cups->printer_list_connection_test = NULL;
 
   cups_get_default_printer (backend_cups);
 }
@@ -538,6 +540,7 @@
   g_free (backend_cups->default_cover_after);
 
   gtk_cups_connection_test_free (backend_cups->default_printer_connection_test);
+  gtk_cups_connection_test_free (backend_cups->printer_list_connection_test);
   
   backend_parent_class->finalize (object);
 }
@@ -1464,6 +1467,7 @@
 static gboolean
 cups_request_printer_list (GtkPrintBackendCups *cups_backend)
 {
+  GtkCupsConnectionState state;
   GtkCupsRequest *request;
   static const char * const pattrs[] =	/* Attributes we're interested in */
     {
@@ -1480,6 +1484,17 @@
       "job-sheets-supported",
       "job-sheets-default"
     };
+
+  state = gtk_cups_connection_test_is_server_available (cups_backend->printer_list_connection_test);
+
+  if (state == GTK_CUPS_CONNECTION_IN_PROGRESS)
+    return TRUE;
+
+  if (state == GTK_CUPS_CONNECTION_NOT_AVAILABLE)
+    {
+      gtk_print_backend_set_list_done (GTK_PRINT_BACKEND (cups_backend));
+      return FALSE;
+    }
  
   if (cups_backend->list_printers_pending ||
       !cups_backend->got_default_printer)
@@ -1513,10 +1528,11 @@
   GtkPrintBackendCups *cups_backend;
 
   cups_backend = GTK_PRINT_BACKEND_CUPS (backend);
+  cups_backend->printer_list_connection_test = gtk_cups_connection_test_new (NULL);
   if (cups_backend->list_printers_poll == 0)
     {
-      cups_request_printer_list (cups_backend);
-      cups_backend->list_printers_poll = gdk_threads_add_timeout_seconds (3,
+      if (cups_request_printer_list (cups_backend))
+        cups_backend->list_printers_poll = gdk_threads_add_timeout_seconds (3,
                                                         (GSourceFunc) cups_request_printer_list,
                                                         backend);
     }
@@ -1877,16 +1893,11 @@
 static gboolean
 cups_request_default_printer (GtkPrintBackendCups *print_backend)
 {
+  GtkCupsConnectionState state;
   GtkCupsRequest *request;
   const char *str;
   char *name = NULL;
 
-  if (!gtk_cups_connection_test_is_server_available (print_backend->default_printer_connection_test))
-    return TRUE;
-
-  gtk_cups_connection_test_free (print_backend->default_printer_connection_test);
-  print_backend->default_printer_connection_test = NULL;
-
   if ((str = g_getenv ("LPDEST")) != NULL)
     {
       print_backend->default_printer = g_strdup (str);
@@ -1910,6 +1921,17 @@
        return FALSE;
     }
 
+  state = gtk_cups_connection_test_is_server_available (print_backend->default_printer_connection_test);
+
+  if (state == GTK_CUPS_CONNECTION_IN_PROGRESS)
+    return TRUE;
+
+  if (state == GTK_CUPS_CONNECTION_NOT_AVAILABLE)
+    return FALSE;
+
+  gtk_cups_connection_test_free (print_backend->default_printer_connection_test);
+  print_backend->default_printer_connection_test = NULL;
+
   request = gtk_cups_request_new (NULL,
                                   GTK_CUPS_POST,
                                   CUPS_GET_DEFAULT,
Index: modules/printbackends/cups/gtkcupsutils.h
===================================================================
--- modules/printbackends/cups/gtkcupsutils.h	(revision 21195)
+++ modules/printbackends/cups/gtkcupsutils.h	(working copy)
@@ -59,7 +59,14 @@
   GTK_CUPS_HTTP_WRITE
 } GtkCupsPollState;
 
+typedef enum
+{
+  GTK_CUPS_CONNECTION_AVAILABLE,
+  GTK_CUPS_CONNECTION_NOT_AVAILABLE,
+  GTK_CUPS_CONNECTION_IN_PROGRESS  
+} GtkCupsConnectionState;
 
+
 struct _GtkCupsRequest 
 {
   GtkCupsRequestType type;
@@ -84,10 +91,10 @@
 struct _GtkCupsConnectionTest
 {
 #ifdef HAVE_CUPS_API_1_2
-  http_addrlist_t *addrlist;
-  http_addrlist_t *current_addr;
-  gboolean         success_at_init;
-  gint             socket;
+  GtkCupsConnectionState at_init;
+  http_addrlist_t       *addrlist;
+  http_addrlist_t       *current_addr;
+  gint                   socket;
 #endif
 };
 
@@ -150,7 +157,7 @@
 int                     gtk_cups_result_get_error_code               (GtkCupsResult      *result);
 const char            * gtk_cups_result_get_error_string             (GtkCupsResult      *result);
 GtkCupsConnectionTest * gtk_cups_connection_test_new                 (const char            *server);
-gboolean                gtk_cups_connection_test_is_server_available (GtkCupsConnectionTest *test);
+GtkCupsConnectionState  gtk_cups_connection_test_is_server_available (GtkCupsConnectionTest *test);
 void                    gtk_cups_connection_test_free                (GtkCupsConnectionTest *test);
 
 G_END_DECLS
