Mercurial > pidgin
diff libpurple/protocols/bonjour/jabber.c @ 23567:a9db0aec7e59
Fix running several Bonjour instances on the same machine.
The server socket had SO_REUSEADDR set, which was causing all the instances to
share the same port (and therefore it was indeterminate who would actually get
the incoming connection).
Fixes #6231
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Sat, 19 Jul 2008 00:18:18 +0000 |
parents | ef0bcbe33689 |
children | 0dd3df365017 |
line wrap: on
line diff
--- a/libpurple/protocols/bonjour/jabber.c Fri Jul 18 21:10:23 2008 +0000 +++ b/libpurple/protocols/bonjour/jabber.c Sat Jul 19 00:18:18 2008 +0000 @@ -672,7 +672,6 @@ bonjour_jabber_start(BonjourJabber *jdata) { struct sockaddr_in my_addr; - int yes = 1; int i; gboolean bind_successful; @@ -686,16 +685,6 @@ return -1; } - /* Make the socket reusable */ - if (setsockopt(jdata->socket, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) != 0) - { - purple_debug_error("bonjour", "Error setting socket options: %s\n", g_strerror(errno)); - purple_connection_error_reason (jdata->account->gc, - PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Error setting socket options")); - return -1; - } - memset(&my_addr, 0, sizeof(struct sockaddr_in)); my_addr.sin_family = AF_INET; @@ -709,6 +698,8 @@ bind_successful = TRUE; break; } + + purple_debug_info("bonjour", "Unable to bind to port %u.(%s)\n", jdata->port, g_strerror(errno)); jdata->port++; }