Removed optional definition of _lm_sock_set_keepalive.
authorMikael Hallendal <micke@imendio.com>
Sat, 25 Oct 2008 16:37:41 +0200
changeset 546 590cf5cd6ea1
parent 545 58954d98a7f9
child 547 692c7753f64e
Removed optional definition of _lm_sock_set_keepalive. Always define the method but make the implementation noop if TCP keep alives are not available.
loudmouth/lm-internals.h
loudmouth/lm-sock.c
--- 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)