[gtk+/gtk-3-8] printing: Show Avahi printers on IPv6 network
- From: Marek Kašík <mkasik src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-8] printing: Show Avahi printers on IPv6 network
- Date: Wed, 13 Mar 2013 09:56:34 +0000 (UTC)
commit 16c9f37b18a40db5b9e113ce27a7efead2e46d42
Author: Marek Kasik <mkasik redhat com>
Date: Tue Mar 12 16:26:37 2013 +0100
printing: Show Avahi printers on IPv6 network
Create correct URIs for printers on IPv6 networks.
modules/printbackends/cups/gtkprintbackendcups.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/modules/printbackends/cups/gtkprintbackendcups.c
b/modules/printbackends/cups/gtkprintbackendcups.c
index 4d095de..60faad0 100644
--- a/modules/printbackends/cups/gtkprintbackendcups.c
+++ b/modules/printbackends/cups/gtkprintbackendcups.c
@@ -2533,6 +2533,7 @@ avahi_resolver_found_cb (GaServiceResolver *resolver,
{
GtkPrintBackendCups *backend = GTK_PRINT_BACKEND_CUPS (user_data);
AvahiStringList *item;
+ const gchar *protocol_string;
gchar host[AVAHI_ADDRESS_STR_MAX];
gchar *suffix = NULL;
gchar *printer_uri;
@@ -2546,9 +2547,14 @@ avahi_resolver_found_cb (GaServiceResolver *resolver,
if (suffix)
{
if (g_strcmp0 (type, "_ipp._tcp") == 0)
- printer_uri = g_strdup_printf ("ipp://%s:%u/%s", host, port, suffix);
+ protocol_string = "ipp";
else
- printer_uri = g_strdup_printf ("ipps://%s:%u/%s", host, port, suffix);
+ protocol_string = "ipps";
+
+ if (protocol == GA_PROTOCOL_INET6)
+ printer_uri = g_strdup_printf ("%s://[%s]:%u/%s", protocol_string, host, port, suffix);
+ else
+ printer_uri = g_strdup_printf ("%s://%s:%u/%s", protocol_string, host, port, suffix);
cups_request_avahi_printer_info (printer_uri,
host,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]