Merge commit '36164263f4cceda85ec92568d48016a48f7ad9c9' into betting

This commit is contained in:
Eric Frias 2017-06-20 17:28:41 -04:00
commit 7195e22216
4 changed files with 12 additions and 5 deletions

View file

@ -224,7 +224,9 @@ namespace detail {
if( !_options->count("rpc-endpoint") ) if( !_options->count("rpc-endpoint") )
return; return;
_websocket_server = std::make_shared<fc::http::websocket_server>(); bool enable_deflate_compression = _options->count("enable-permessage-deflate") != 0;
_websocket_server = std::make_shared<fc::http::websocket_server>(enable_deflate_compression);
_websocket_server->on_connection([&]( const fc::http::websocket_connection_ptr& c ){ _websocket_server->on_connection([&]( const fc::http::websocket_connection_ptr& c ){
auto wsc = std::make_shared<fc::rpc::websocket_api_connection>(*c); auto wsc = std::make_shared<fc::rpc::websocket_api_connection>(*c);
@ -251,7 +253,8 @@ namespace detail {
} }
string password = _options->count("server-pem-password") ? _options->at("server-pem-password").as<string>() : ""; string password = _options->count("server-pem-password") ? _options->at("server-pem-password").as<string>() : "";
_websocket_tls_server = std::make_shared<fc::http::websocket_tls_server>( _options->at("server-pem").as<string>(), password ); bool enable_deflate_compression = _options->count("enable-permessage-deflate") != 0;
_websocket_tls_server = std::make_shared<fc::http::websocket_tls_server>( _options->at("server-pem").as<string>(), password, enable_deflate_compression );
_websocket_tls_server->on_connection([&]( const fc::http::websocket_connection_ptr& c ){ _websocket_tls_server->on_connection([&]( const fc::http::websocket_connection_ptr& c ){
auto wsc = std::make_shared<fc::rpc::websocket_api_connection>(*c); auto wsc = std::make_shared<fc::rpc::websocket_api_connection>(*c);
@ -945,6 +948,8 @@ void application::set_program_options(boost::program_options::options_descriptio
("checkpoint,c", bpo::value<vector<string>>()->composing(), "Pairs of [BLOCK_NUM,BLOCK_ID] that should be enforced as checkpoints.") ("checkpoint,c", bpo::value<vector<string>>()->composing(), "Pairs of [BLOCK_NUM,BLOCK_ID] that should be enforced as checkpoints.")
("rpc-endpoint", bpo::value<string>()->implicit_value("127.0.0.1:8090"), "Endpoint for websocket RPC to listen on") ("rpc-endpoint", bpo::value<string>()->implicit_value("127.0.0.1:8090"), "Endpoint for websocket RPC to listen on")
("rpc-tls-endpoint", bpo::value<string>()->implicit_value("127.0.0.1:8089"), "Endpoint for TLS websocket RPC to listen on") ("rpc-tls-endpoint", bpo::value<string>()->implicit_value("127.0.0.1:8089"), "Endpoint for TLS websocket RPC to listen on")
("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<string>()->implicit_value("server.pem"), "The TLS certificate file for this server") ("server-pem,p", bpo::value<string>()->implicit_value("server.pem"), "The TLS certificate file for this server")
("server-pem-password,P", bpo::value<string>()->implicit_value(""), "Password for this certificate") ("server-pem-password,P", bpo::value<string>()->implicit_value(""), "Password for this certificate")
("genesis-json", bpo::value<boost::filesystem::path>(), "File to read Genesis State from") ("genesis-json", bpo::value<boost::filesystem::path>(), "File to read Genesis State from")

View file

@ -212,7 +212,7 @@ namespace graphene { namespace chain {
time_point_sec feed_expiration_time()const time_point_sec feed_expiration_time()const
{ return current_feed_publication_time + options.feed_lifetime_sec; } { return current_feed_publication_time + options.feed_lifetime_sec; }
bool feed_is_expired(time_point_sec current_time)const 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); void update_median_feeds(time_point_sec current_time);
}; };

View file

@ -82,6 +82,8 @@ void operator<<( Stream& stream, const graphene::chain::extension<T>& value )
fc::reflector<T>::visit( read_vtor ); fc::reflector<T>::visit( read_vtor );
} }
template< typename Stream, typename T > template< typename Stream, typename T >
struct graphene_extension_unpack_visitor struct graphene_extension_unpack_visitor
{ {
@ -108,7 +110,7 @@ struct graphene_extension_unpack_visitor
{ {
if( (count_left > 0) && (which == next_which) ) if( (count_left > 0) && (which == next_which) )
{ {
Member temp; typename Member::value_type temp;
fc::raw::unpack( stream, temp ); fc::raw::unpack( stream, temp );
(value.*member) = temp; (value.*member) = temp;
--count_left; --count_left;

@ -1 +1 @@
Subproject commit 9d408aa53267834542279490eac4c25878107967 Subproject commit 2c8cdf84b75fe07f75e49dd43ae9ad5c3d5a129c