From 1b16e15585b8f1f520411d18ccd9742f66269ca4 Mon Sep 17 00:00:00 2001 From: Eric Frias Date: Thu, 10 Apr 2014 14:27:20 -0400 Subject: [PATCH 1/2] Quiet compiler warning signed vs unsigned --- include/fc/io/raw_variant.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fc/io/raw_variant.hpp b/include/fc/io/raw_variant.hpp index 8e3630b..b754cda 100644 --- a/include/fc/io/raw_variant.hpp +++ b/include/fc/io/raw_variant.hpp @@ -133,7 +133,7 @@ namespace fc { namespace raw { mutable_variant_object mvo; mvo.reserve(vs.value); - for( auto i = 0; i < vs.value; ++i ) + for( uint32_t i = 0; i < vs.value; ++i ) { fc::string key; fc::variant value; From 7849cc7adaf316ef24065783db28504a33ded55b Mon Sep 17 00:00:00 2001 From: Eric Frias Date: Tue, 15 Apr 2014 13:40:19 -0400 Subject: [PATCH 2/2] Get keepalive code building on os x --- src/network/tcp_socket.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/network/tcp_socket.cpp b/src/network/tcp_socket.cpp index 864199a..382a938 100644 --- a/src/network/tcp_socket.cpp +++ b/src/network/tcp_socket.cpp @@ -84,13 +84,18 @@ namespace fc { if (WSAIoctl(my->_sock.native(), SIO_KEEPALIVE_VALS, &keepalive_settings, sizeof(keepalive_settings), NULL, 0, &dwBytesRet, NULL, NULL) == SOCKET_ERROR) wlog("Error setting TCP keepalive values"); -#elif !defined( __APPLE__ ) // TODO: add proper support for OS X Mavericks... SOL_TCP and TCP_KEEPIDLE are not defined +#else // This should work for modern Linuxes and for OSX >= Mountain Lion int timeout_sec = interval.count() / fc::seconds(1).count(); - if (setsockopt(my->_sock.native(), SOL_TCP, TCP_KEEPIDLE, + if (setsockopt(my->_sock.native(), IPPROTO_TCP, +# if defined( __APPLE__ ) + TCP_KEEPALIVE, +# else + TCP_KEEPIDLE, +# endif (char*)&timeout_sec, sizeof(timeout_sec)) < 0) wlog("Error setting TCP keepalive idle time"); - if (setsockopt(my->_sock.native(), SOL_TCP, TCP_KEEPINTVL, + if (setsockopt(my->_sock.native(), IPPROTO_TCP, TCP_KEEPINTVL, (char*)&timeout_sec, sizeof(timeout_sec)) < 0) wlog("Error setting TCP keepalive interval"); #endif