[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: icecream
From: Stephan Kulow <coolo () kde ! org>
Date: 2007-04-25 15:32:59
Message-ID: 1177515179.937802.19491.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 657961 by coolo:
compile a bit better
M +1 -1 client/main.cpp
M +2 -2 configure.in
M +24 -3 services/comm.cpp
--- trunk/icecream/client/main.cpp #657960:657961
@@ -52,7 +52,7 @@
#include <sys/time.h>
#include <comm.h>
#include <sys/types.h>
-#if defined(__FreeBSD__) || defined(__DragonFly__)
+#if HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <sys/wait.h>
--- trunk/icecream/configure.in #657960:657961
@@ -34,7 +34,7 @@
# Some of these are needed by popt (or other libraries included in the future).
AC_CHECK_HEADERS([unistd.h stdint.h sys/types.h sys/signal.h ifaddrs.h])
-AC_CHECK_HEADERS([ctype.h sys/resource.h sys/socket.h sys/select.h sys/vfs.h])
+AC_CHECK_HEADERS([ctype.h sys/resource.h sys/socket.h sys/stat.h sys/select.h sys/vfs.h])
AC_CHECK_HEADERS([netinet/in.h], [], [],
[#if HAVE_SYS_TYPES_H
# include <sys/types.h>
@@ -57,7 +57,7 @@
#endif
])
-AC_CHECK_HEADERS([float.h mcheck.h alloca.h sys/mman.h])
+AC_CHECK_HEADERS([float.h mcheck.h alloca.h sys/mman.h netinet/tcp_var.h])
AC_CHECK_HEADERS([sys/user.h])
######################################################################
--- trunk/icecream/services/comm.cpp #657960:657961
@@ -20,6 +20,7 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#include <config.h>
#include <sys/types.h>
#include <netinet/in.h>
@@ -28,6 +29,10 @@
#include <sys/select.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
+#if HAVE_NETINET_TCP_VAR_H
+#include <sys/socketvar.h>
+#include <netinet/tcp_var.h>
+#endif
#include <errno.h>
#include <fcntl.h>
#include <netdb.h>
@@ -435,7 +440,7 @@
Remove the buffer, and indicate there is nothing in it,
but don't reset the compressed_len, so our caller know,
that there actually was something read in. */
- log_error() << "internal error - decompression of data from " << dump().c_str()
+ log_error() << "internal error - decompression of data from " << dump().c_str()
<< " failed: " << ret << endl;
delete [] *uncompressed_buf;
*uncompressed_buf = 0;
@@ -682,13 +687,29 @@
int on = 1;
if (!setsockopt (_fd, SOL_SOCKET, SO_KEEPALIVE, (char*) &on, sizeof(on)))
{
+#if defined( TCP_KEEPIDLE )
+ int keepidle = TCP_KEEPIDLE;
+#else
+ int keepidle = TCPCTL_KEEPIDLE;
+#endif
+
int sec;
sec = MAX_SCHEDULER_PING - 3 * MAX_SCHEDULER_PONG;
- setsockopt (_fd, IPPROTO_TCP, TCP_KEEPIDLE, (char*) &sec, sizeof(sec));
+ setsockopt (_fd, IPPROTO_TCP, keepidle, (char*) &sec, sizeof(sec));
+
+#if defined( TCP_KEEPINTVL )
+ int keepintvl = TCP_KEEPINTVL;
+#else
+ int keepintvl = TCPCTL_KEEPINTVL;
+#endif
+
sec = MAX_SCHEDULER_PONG;
- setsockopt (_fd, IPPROTO_TCP, TCP_KEEPINTVL, (char*) &sec, sizeof(sec));
+ setsockopt (_fd, IPPROTO_TCP, keepintvl, (char*) &sec, sizeof(sec));
+
+#ifdef TCP_KEEPCNT
sec = 3;
setsockopt (_fd, IPPROTO_TCP, TCP_KEEPCNT, (char*) &sec, sizeof(sec));
+#endif
}
if (fcntl (fd, F_SETFL, O_NONBLOCK) < 0)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic