GNOME Bugzilla – Bug 603637
gtk printer dialog does not show remote printer
Last modified: 2010-06-03 08:14:56 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
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
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 ?
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
Ah, I hadn't seen that. Looks ok then.
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