Removed optional definition of _lm_sock_set_keepalive.
Always define the method but make the implementation noop if TCP keep alives are not available.
--- a/loudmouth/lm-internals.h Sat Oct 25 16:21:50 2008 +0200
+++ b/loudmouth/lm-internals.h Sat Oct 25 16:37:41 2008 +0200
@@ -114,9 +114,6 @@
_lm_sock_addrinfo_get_error_str (int err);
gchar * _lm_sock_get_local_host (LmOldSocketT sock);
-#ifdef USE_TCP_KEEPALIVES
gboolean _lm_sock_set_keepalive (LmOldSocketT sock,
int delay);
-#endif /* USE_TCP_KEEPALIVES */
-
#endif /* __LM_INTERNALS_H__ */
--- a/loudmouth/lm-sock.c Sat Oct 25 16:21:50 2008 +0200
+++ b/loudmouth/lm-sock.c Sat Oct 25 16:37:41 2008 +0200
@@ -309,10 +309,10 @@
return _("The remote address could not be obtained ");
}
-#ifdef USE_TCP_KEEPALIVES
gboolean
_lm_sock_set_keepalive (LmOldSocketT sock, int delay)
{
+#ifdef USE_TCP_KEEPALIVES
int opt;
opt = 1;
@@ -334,10 +334,10 @@
if (setsockopt (sock, IPPROTO_TCP, TCP_KEEPINTVL, &opt, sizeof (opt)) < 0) {
return FALSE;
}
+#endif /* USE_TCP_KEEPALIVES */
return TRUE;
}
-#endif /* USE_TCP_KEEPALIVES */
gchar *
_lm_sock_get_local_host (LmOldSocketT sock)