After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 603637 - gtk printer dialog does not show remote printer
gtk printer dialog does not show remote printer
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Printing
2.18.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2009-12-02 19:21 UTC by Bernhard M.
Modified: 2010-06-03 08:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test all given addresses when printing (2.76 KB, patch)
2010-05-26 14:00 UTC, Marek Kašík
needs-work Details | Review
modified patch (2.78 KB, patch)
2010-05-27 11:08 UTC, Marek Kašík
none Details | Review

Description Bernhard M. 2009-12-02 19:21:35 UTC
also filed at https://bugzilla.novell.com/show_bug.cgi?id=546013

I have a cupsd printer server/daemon running on a machine "flash.zq1.de" that has both IPv4 and IPv6 addresses (A and AAAA record), but cupsd only listens on IPv4.

When I try to print from firefox, seamonkey2, gimp or evince in openSUSE-11.2 (also 11.1) it only offers "print to file".

Probable reason is that it correcly tries to connect via IPv6 first, but after getting a "Connection Refused" it does not retry IPv4.


How to reproduce (replace IPs for your setup below):
echo 192.168.11.92 printserver >> /etc/hosts
echo 2001:6f8:11fc:10:240:f4ff:fe68:2e5 printserver >> /etc/hosts
echo ServerName printserver > /etc/cups/client.conf

and on printserver have
/etc/cups/cupsd.conf:Listen 0.0.0.0:631
Comment 1 Marek Kašík 2010-05-26 14:00:59 UTC
Created attachment 162019 [details] [review]
test all given addresses when printing

Hi Bernhard,

you are right, gtk+ doesn't check other addresses given by CUPS if the first one fails. Attached is a patch which fixes this.

Thank you for this report

Marek
Comment 2 Matthias Clasen 2010-05-26 15:03:44 UTC
Review of attachment 162019 [details] [review]:

::: modules/printbackends/cups/gtkcupsutils.c
@@ +1544,3 @@
+          if (test->last_wrong_addr != NULL && test->last_wrong_addr->next != NULL)
+            iter = test->last_wrong_addr->next;
+          else {

should put the { on the next line here

@@ +1597,3 @@
+                  test->last_wrong_addr = test->current_addr;
+                  result = GTK_CUPS_CONNECTION_NOT_AVAILABLE;
+                }

Not sure I understand the logic in this loop. Why is iter not incremented in the loop body ?
Comment 3 Marek Kašík 2010-05-27 11:08:09 UTC
Created attachment 162088 [details] [review]
modified patch

Hi Matthias,

I'm sorry about the bracket.
The iter is incremented in the loop:

 while (iter)
   {
     ...
     if (test->socket >= 0)
       {
         ...
       }
     iter = iter->next;
   }

The patch works so that it test whether it tries to get a socket, if it gets it then it goes to the next section where it tries to "connect". If not then it tries next address from CUPS (the while loop). But if it gets socket and cannot "connect" then we mark the address as wrong and it tries the next address in the next calling of gtk_cups_connection_test_get_state().

Marek
Comment 4 Matthias Clasen 2010-06-02 16:13:18 UTC
Ah, I hadn't seen that. Looks ok then.
Comment 5 Marek Kašík 2010-06-03 08:14:56 UTC
Committed to trunk:

    Test connection to all given addresses when printing
    
    Go to the next address given by CUPS if we fail to connect to
    previous address (#603637).

Marek