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 695714 - Getting of printer info can hang
Getting of printer info can hang
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Printing
3.7.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-03-12 16:27 UTC by Marek Kašík
Modified: 2013-03-13 14:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
don't hang when getting info for Avahi printer (5.86 KB, patch)
2013-03-12 16:27 UTC, Marek Kašík
needs-work Details | Review

Description Marek Kašík 2013-03-12 16:27:02 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).
Comment 1 Matthias Clasen 2013-03-13 13:37:06 UTC
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 ?
Comment 2 Marek Kašík 2013-03-13 14:08:06 UTC
Thank you for the review. I've modified the patch according to your comments and pushed it into gtk-3-8 and master.