GNOME Bugzilla – Bug 695714
Getting of printer info can hang
Last modified: 2013-03-13 14:08:06 UTC
Created attachment 238707 [details] [review] don't hang when getting info for Avahi printer When getting info about a printer advertised on Avahi it can happen that address returned by Avahi resolver is not correct (a printer returns IPv4 address on IPv6 network on my machine). This hangs CUPS backend in httpConnect() when getting info for this printer. Attached patch adds asynchronous test of connection to this address. It doesn't try to get info from addresses for which the test fails. The patch has to be applied after the patch from https://bugzilla.gnome.org/show_bug.cgi?id=695713. This can be related to https://bugzilla.gnome.org/show_bug.cgi?id=695354 (but I think that it is not).
Review of attachment 238707 [details] [review]: Looks ok to me, otherwise ::: modules/printbackends/cups/gtkprintbackendcups.c @@ +2546,3 @@ + g_object_unref (source_object); + + if (connection) Not sure I've mentioned it before, but depending on the day, I sometimes prefer if (connection != NULL) ie make the NULL check explicit instead of relying on the implicit conversion to boolean... But as I said, on other days, I'm just fine with this shorthand... @@ +2561,3 @@ + else + { + g_error_free (error); Why pass a GError in the first place if you are not using it at all ?
Thank you for the review. I've modified the patch according to your comments and pushed it into gtk-3-8 and master.