From a83af9208ea93cdbde9b9ee66eaba5babc7e78fc Mon Sep 17 00:00:00 2001 From: theoreticalbts Date: Fri, 26 Feb 2016 14:24:22 -0500 Subject: [PATCH 1/5] ext.hpp: Fix extension unpacking #599 --- libraries/chain/include/graphene/chain/protocol/ext.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/chain/include/graphene/chain/protocol/ext.hpp b/libraries/chain/include/graphene/chain/protocol/ext.hpp index 7e8636f5..ac775535 100644 --- a/libraries/chain/include/graphene/chain/protocol/ext.hpp +++ b/libraries/chain/include/graphene/chain/protocol/ext.hpp @@ -82,6 +82,8 @@ void operator<<( Stream& stream, const graphene::chain::extension& value ) fc::reflector::visit( read_vtor ); } + + template< typename Stream, typename T > struct graphene_extension_unpack_visitor { @@ -108,7 +110,7 @@ struct graphene_extension_unpack_visitor { if( (count_left > 0) && (which == next_which) ) { - Member temp; + typename Member::value_type temp; fc::raw::unpack( stream, temp ); (value.*member) = temp; --count_left; From 529f0bef0eeaef6424c6ff10cbb6415c35b7fe03 Mon Sep 17 00:00:00 2001 From: theoreticalbts Date: Fri, 26 Feb 2016 15:14:20 -0500 Subject: [PATCH 2/5] Bump fc --- libraries/fc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/fc b/libraries/fc index 83b4de06..38419164 160000 --- a/libraries/fc +++ b/libraries/fc @@ -1 +1 @@ -Subproject commit 83b4de067a6c99704a6d21d6dfc8b1e838ddcaf7 +Subproject commit 38419164b6f1ade468bf4b1d27929b3ac2503b6e From 3c6f4ce22359f08e1436c3a645a03b3d95e56521 Mon Sep 17 00:00:00 2001 From: abitmore Date: Wed, 9 Mar 2016 14:37:33 +0100 Subject: [PATCH 3/5] Fix price feed expiration check, fix #540 --- libraries/chain/include/graphene/chain/asset_object.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/chain/include/graphene/chain/asset_object.hpp b/libraries/chain/include/graphene/chain/asset_object.hpp index f893f34a..3bde61b3 100644 --- a/libraries/chain/include/graphene/chain/asset_object.hpp +++ b/libraries/chain/include/graphene/chain/asset_object.hpp @@ -212,7 +212,7 @@ namespace graphene { namespace chain { time_point_sec feed_expiration_time()const { return current_feed_publication_time + options.feed_lifetime_sec; } bool feed_is_expired(time_point_sec current_time)const - { return feed_expiration_time() >= current_time; } + { return feed_expiration_time() <= current_time; } void update_median_feeds(time_point_sec current_time); }; From 403d3001f6451d1ef46cd832d11d07106eeefc40 Mon Sep 17 00:00:00 2001 From: Eric Frias Date: Thu, 10 Mar 2016 17:33:14 -0500 Subject: [PATCH 4/5] Add a command-line option to witness_node, --disable-permessage-deflate to prevent the websocket server from allowing compression on clients that support it. #619 --- libraries/app/application.cpp | 9 +++++++-- libraries/fc | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/libraries/app/application.cpp b/libraries/app/application.cpp index d71f3867..6ab43885 100644 --- a/libraries/app/application.cpp +++ b/libraries/app/application.cpp @@ -180,7 +180,9 @@ namespace detail { if( !_options->count("rpc-endpoint") ) return; - _websocket_server = std::make_shared(); + bool enable_deflate_compression = _options->count("disable-permessage-deflate") == 0; + + _websocket_server = std::make_shared(enable_deflate_compression); _websocket_server->on_connection([&]( const fc::http::websocket_connection_ptr& c ){ auto wsc = std::make_shared(*c); @@ -207,7 +209,8 @@ namespace detail { } string password = _options->count("server-pem-password") ? _options->at("server-pem-password").as() : ""; - _websocket_tls_server = std::make_shared( _options->at("server-pem").as(), password ); + bool enable_deflate_compression = _options->count("disable-permessage-deflate") == 0; + _websocket_tls_server = std::make_shared( _options->at("server-pem").as(), password, enable_deflate_compression ); _websocket_tls_server->on_connection([&]( const fc::http::websocket_connection_ptr& c ){ auto wsc = std::make_shared(*c); @@ -900,6 +903,8 @@ void application::set_program_options(boost::program_options::options_descriptio ("checkpoint,c", bpo::value>()->composing(), "Pairs of [BLOCK_NUM,BLOCK_ID] that should be enforced as checkpoints.") ("rpc-endpoint", bpo::value()->implicit_value("127.0.0.1:8090"), "Endpoint for websocket RPC to listen on") ("rpc-tls-endpoint", bpo::value()->implicit_value("127.0.0.1:8089"), "Endpoint for TLS websocket RPC to listen on") + ("disable-permessage-deflate", "Disable support for per-message deflate compression in the websocket servers " + "(--rpc-endpoint and --rpc-tls-endpoint), enabled by default") ("server-pem,p", bpo::value()->implicit_value("server.pem"), "The TLS certificate file for this server") ("server-pem-password,P", bpo::value()->implicit_value(""), "Password for this certificate") ("genesis-json", bpo::value(), "File to read Genesis State from") diff --git a/libraries/fc b/libraries/fc index 38419164..21045dde 160000 --- a/libraries/fc +++ b/libraries/fc @@ -1 +1 @@ -Subproject commit 38419164b6f1ade468bf4b1d27929b3ac2503b6e +Subproject commit 21045dde5faa8fcf5f43b97c85f9df210317633b From 36164263f4cceda85ec92568d48016a48f7ad9c9 Mon Sep 17 00:00:00 2001 From: Eric Frias Date: Mon, 14 Mar 2016 18:27:28 -0400 Subject: [PATCH 5/5] Make websocket compression disabled by default, since it causes problems in Chrome. Change the command line option to --enable-permessage-deflate to override. #619 --- libraries/app/application.cpp | 8 ++++---- libraries/fc | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libraries/app/application.cpp b/libraries/app/application.cpp index 6ab43885..64464488 100644 --- a/libraries/app/application.cpp +++ b/libraries/app/application.cpp @@ -180,7 +180,7 @@ namespace detail { if( !_options->count("rpc-endpoint") ) return; - bool enable_deflate_compression = _options->count("disable-permessage-deflate") == 0; + bool enable_deflate_compression = _options->count("enable-permessage-deflate") != 0; _websocket_server = std::make_shared(enable_deflate_compression); @@ -209,7 +209,7 @@ namespace detail { } string password = _options->count("server-pem-password") ? _options->at("server-pem-password").as() : ""; - bool enable_deflate_compression = _options->count("disable-permessage-deflate") == 0; + bool enable_deflate_compression = _options->count("enable-permessage-deflate") != 0; _websocket_tls_server = std::make_shared( _options->at("server-pem").as(), password, enable_deflate_compression ); _websocket_tls_server->on_connection([&]( const fc::http::websocket_connection_ptr& c ){ @@ -903,8 +903,8 @@ void application::set_program_options(boost::program_options::options_descriptio ("checkpoint,c", bpo::value>()->composing(), "Pairs of [BLOCK_NUM,BLOCK_ID] that should be enforced as checkpoints.") ("rpc-endpoint", bpo::value()->implicit_value("127.0.0.1:8090"), "Endpoint for websocket RPC to listen on") ("rpc-tls-endpoint", bpo::value()->implicit_value("127.0.0.1:8089"), "Endpoint for TLS websocket RPC to listen on") - ("disable-permessage-deflate", "Disable support for per-message deflate compression in the websocket servers " - "(--rpc-endpoint and --rpc-tls-endpoint), enabled by default") + ("enable-permessage-deflate", "Enable support for per-message deflate compression in the websocket servers " + "(--rpc-endpoint and --rpc-tls-endpoint), disabled by default") ("server-pem,p", bpo::value()->implicit_value("server.pem"), "The TLS certificate file for this server") ("server-pem-password,P", bpo::value()->implicit_value(""), "Password for this certificate") ("genesis-json", bpo::value(), "File to read Genesis State from") diff --git a/libraries/fc b/libraries/fc index 21045dde..622ff580 160000 --- a/libraries/fc +++ b/libraries/fc @@ -1 +1 @@ -Subproject commit 21045dde5faa8fcf5f43b97c85f9df210317633b +Subproject commit 622ff58039f2388433272a44fe416f5b8025589a