summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorMarek Kasik <mkasik@redhat.com>2013-07-31 10:53:49 +0200
committerMarek Kasik <mkasik@redhat.com>2013-07-31 10:56:29 +0200
commitd264695c827a7702006d09c2dff853b6be454155 (patch)
tree614977ed391c4abbece8d264ca3c5e3d5d4a2b0e /plugins
parentfc2838076c1de3bff38020187b6d1a9b18a7237c (diff)
downloadgnome-settings-daemon-d264695c827a7702006d09c2dff853b6be454155.tar.gz
print-notifications: Honor CUPS' default port number
Don't default to "631" for default port when testing connection to remote CUPS server.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/print-notifications/gsd-print-notifications-manager.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/plugins/print-notifications/gsd-print-notifications-manager.c b/plugins/print-notifications/gsd-print-notifications-manager.c
index 954a9191..3615c821 100644
--- a/plugins/print-notifications/gsd-print-notifications-manager.c
+++ b/plugins/print-notifications/gsd-print-notifications-manager.c
@@ -954,17 +954,20 @@ renew_subscription_with_connection_test (gpointer user_data)
{
GSocketClient *client;
gchar *address;
+ int port;
- address = g_strdup_printf ("%s:%d", cupsServer (), ippPort ());
+ port = ippPort ();
+
+ address = g_strdup_printf ("%s:%d", cupsServer (), port);
if (address && address[0] != '/') {
client = g_socket_client_new ();
- g_debug ("Initiating test connection to CUPS server \'%s:%d\'.", cupsServer (), ippPort ());
+ g_debug ("Initiating test connection to CUPS server \'%s:%d\'.", cupsServer (), port);
g_socket_client_connect_to_host_async (client,
address,
- 631,
+ port,
NULL,
renew_subscription_with_connection_test_cb,
user_data);
@@ -1017,18 +1020,19 @@ cups_connection_test (gpointer user_data)
GsdPrintNotificationsManager *manager = (GsdPrintNotificationsManager *) user_data;
GSocketClient *client;
gchar *address;
+ int port = ippPort ();
if (!manager->priv->dests) {
- address = g_strdup_printf ("%s:%d", cupsServer (), ippPort ());
+ address = g_strdup_printf ("%s:%d", cupsServer (), port);
if (address && address[0] != '/') {
client = g_socket_client_new ();
- g_debug ("Initiating test connection to CUPS server \'%s:%d\'.", cupsServer (), ippPort ());
+ g_debug ("Initiating test connection to CUPS server \'%s:%d\'.", cupsServer (), port);
g_socket_client_connect_to_host_async (client,
address,
- 631,
+ port,
NULL,
cups_connection_test_cb,
manager);