Mercurial > pidgin
diff libpurple/media.c @ 26013:8b54456cba97
disapproval of revision '106c6ba87b3a431f8ec3adad7e4e569f3d008f83'
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Sat, 10 Jan 2009 01:26:27 +0000 |
parents | c80f151b159a |
children | ade5b2c51047 68ebba87143b |
line wrap: on
line diff
--- a/libpurple/media.c Sat Jan 10 00:49:07 2009 +0000 +++ b/libpurple/media.c Sat Jan 10 01:26:27 2009 +0000 @@ -1277,34 +1277,25 @@ stream->session->id, stream->participant); } -/* this should probably be made IPv6-compatible some time, and made async? - maybe this should be a public function in libpurple...*/ -static gchar * -purple_media_get_ip(const gchar *hostname) -{ - struct hostent *host; - - if ((host = gethostbyname(hostname)) && host->h_addr) { - gchar *ip = g_strdup_printf("%hhu.%hhu.%hhu.%hhu", - host->h_addr[0], host->h_addr[1], - host->h_addr[2], host->h_addr[3]); - purple_debug_info("media", "IP address for %s found: %s\n", - hostname, ip); - return ip; - } else { - purple_debug_info("media", "Unable to resolve %s IP address\n", - hostname); - return NULL; - } -} - static gchar * purple_media_get_stun_pref_ip() { const gchar *stun_pref = purple_prefs_get_string("/purple/network/stun_server"); - - return purple_media_get_ip(stun_pref); + struct hostent *host; + + if ((host = gethostbyname(stun_pref)) && host->h_addr) { + gchar *stun_ip = g_strdup_printf("%hhu.%hhu.%hhu.%hhu", + host->h_addr[0], host->h_addr[1], + host->h_addr[2], host->h_addr[3]); + purple_debug_info("media", "IP address for %s found: %s\n", + stun_pref, stun_ip); + return stun_ip; + } else { + purple_debug_info("media", "Unable to resolve %s IP address\n", + stun_pref); + return NULL; + } } static gboolean