[glib] g_network_address_parse: deprecate symbolic port names



commit 4a371c2ce5262cdecc48ab998e9b66ce7b46ee4b
Author: Dan Winship <danw gnome org>
Date:   Sat Sep 3 19:49:19 2011 -0400

    g_network_address_parse: deprecate symbolic port names
    
    (which shouldn't ever have been part of the API. Grr.)
    
    Solaris /etc/services doesn't even have "http", which was causing
    tests/network-address to fail...

 gio/gnetworkaddress.c       |    8 ++++++--
 gio/tests/network-address.c |    1 -
 2 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/gio/gnetworkaddress.c b/gio/gnetworkaddress.c
index 3a58325..e9a9b98 100644
--- a/gio/gnetworkaddress.c
+++ b/gio/gnetworkaddress.c
@@ -279,8 +279,7 @@ g_network_address_new (const gchar *hostname,
  * address, an IPv4 address, or a domain name (in which case a DNS
  * lookup is performed). Quoting with [] is supported for all address
  * types. A port override may be specified in the usual way with a
- * colon. Ports may be given as decimal numbers or symbolic names (in
- * which case an /etc/services lookup is performed).
+ * colon.
  *
  * If no port is specified in @host_and_port then @default_port will be
  * used as the port number to connect to.
@@ -289,6 +288,11 @@ g_network_address_new (const gchar *hostname,
  * (allowing them to give the hostname, and a port overide if necessary)
  * and @default_port is expected to be provided by the application.
  *
+ * (The port component of @host_and_port can also be specified as a
+ * service name rather than as a numeric port, but this functionality
+ * is deprecated, because it depends on the contents of /etc/services,
+ * which is generally quite sparse on platforms other than Linux.)
+ *
  * Return value: (transfer full): the new #GNetworkAddress, or %NULL on error
  *
  * Since: 2.22
diff --git a/gio/tests/network-address.c b/gio/tests/network-address.c
index aabb8ef..aa04648 100644
--- a/gio/tests/network-address.c
+++ b/gio/tests/network-address.c
@@ -34,7 +34,6 @@ static ParseTest tests[] =
 {
   { "www.gnome.org", "www.gnome.org", 1234, -1 },
   { "www.gnome.org:8080", "www.gnome.org", 8080, -1 },
-  { "www.gnome.org:http", "www.gnome.org", 80, -1 },
   { "[2001:db8::1]", "2001:db8::1", 1234, -1 },
   { "[2001:db8::1]:888", "2001:db8::1", 888, -1 },
   { "[hostname", NULL, 0, G_IO_ERROR_INVALID_ARGUMENT },



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]