--- a/loudmouth/lm-blocking-resolver.c Mon Feb 23 21:28:40 2009 -0800
+++ b/loudmouth/lm-blocking-resolver.c Mon Feb 23 23:09:45 2009 -0800
@@ -102,7 +102,7 @@
/* Lookup */
memset (&req, 0, sizeof(req));
- req.ai_family = AF_INET;
+ req.ai_family = PF_UNSPEC;
req.ai_socktype = SOCK_STREAM;
req.ai_protocol = IPPROTO_TCP;
--- a/loudmouth/lm-old-socket.c Mon Feb 23 21:28:40 2009 -0800
+++ b/loudmouth/lm-old-socket.c Mon Feb 23 23:09:45 2009 -0800
@@ -470,7 +470,7 @@
socket_close_io_channel (connect_data->io_channel);
}
- if (connect_data->current_addr == NULL) {
+ if (connect_data->current_addr == NULL) { /*Ran Out Of Addresses*/
if (socket->connect_func) {
(socket->connect_func) (socket, FALSE, socket->user_data);
}
@@ -784,7 +784,15 @@
socket->connect_data->current_addr =
lm_resolver_results_get_next (resolver);
- socket_do_connect (socket->connect_data);
+ if (socket->connect_data->current_addr) {
+ socket_do_connect (socket->connect_data);
+ } else { /* FIXME: IPv6 Support? */
+ g_log (LM_LOG_DOMAIN,G_LOG_LEVEL_ERROR,
+ "Unable to locate server available over IPv4.\n");
+ };
+
+ /* FIXME: What do we do here? How to make the mainloop exit with an
+ error, while having no ref to said mainloop */
}
/* FIXME: Need to have a way to only get srv reply and then decide if the
--- a/loudmouth/lm-resolver.c Mon Feb 23 21:28:40 2009 -0800
+++ b/loudmouth/lm-resolver.c Mon Feb 23 23:09:45 2009 -0800
@@ -383,12 +383,14 @@
priv = GET_PRIV (resolver);
- if (!priv->current_result) {
+skipresult:
+ if (!priv->current_result)
return NULL;
- }
ret_val = priv->current_result;
priv->current_result = priv->current_result->ai_next;
+ if (ret_val->ai_family != AF_INET) /* FIXME: we only support IPv4 for now */
+ goto skipresult;
return ret_val;
}