Revert "Merge branch 'graphene_master' into bitshares"

This reverts commit 2d0a7a2a4d, reversing
changes made to 6684fb75ac.
This commit is contained in:
Eric Frias 2016-03-11 14:19:31 -05:00
parent 2d0a7a2a4d
commit b175cc7feb
6 changed files with 8 additions and 48 deletions

View file

@ -226,9 +226,7 @@ namespace detail {
if( !_options->count("rpc-endpoint") ) if( !_options->count("rpc-endpoint") )
return; return;
bool enable_deflate_compression = _options->count("disable-permessage-deflate") == 0; _websocket_server = std::make_shared<fc::http::websocket_server>();
_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);
@ -255,8 +253,7 @@ 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>() : "";
bool enable_deflate_compression = _options->count("disable-permessage-deflate") == 0; _websocket_tls_server = std::make_shared<fc::http::websocket_tls_server>( _options->at("server-pem").as<string>(), password );
_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);
@ -950,8 +947,6 @@ 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")
("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<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,8 +82,6 @@ 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
{ {
@ -110,7 +108,7 @@ struct graphene_extension_unpack_visitor
{ {
if( (count_left > 0) && (which == next_which) ) if( (count_left > 0) && (which == next_which) )
{ {
typename Member::value_type temp; Member 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 21045dde5faa8fcf5f43b97c85f9df210317633b Subproject commit d5370fc2ea436fa4340cda01af98c7993fbc67d5

View file

@ -3952,20 +3952,12 @@ namespace graphene { namespace net { namespace detail {
} }
unsigned handle_message_call_count = 0; unsigned handle_message_call_count = 0;
while( true ) for (fc::future<void>& handle_message_call : _handle_message_calls_in_progress)
{ {
auto it = _handle_message_calls_in_progress.begin();
if( it == _handle_message_calls_in_progress.end() )
break;
if( it->ready() || it->error() || it->canceled() )
{
_handle_message_calls_in_progress.erase( it );
continue;
}
++handle_message_call_count; ++handle_message_call_count;
try try
{ {
it->cancel_and_wait("node_impl::close()"); handle_message_call.cancel_and_wait("node_impl::close()");
dlog("handle_message call #${count} task terminated", ("count", handle_message_call_count)); dlog("handle_message call #${count} task terminated", ("count", handle_message_call_count));
} }
catch ( const fc::canceled_exception& ) catch ( const fc::canceled_exception& )
@ -3981,6 +3973,7 @@ namespace graphene { namespace net { namespace detail {
wlog("Exception thrown while terminating handle_message call #${count} task, ignoring",("count", handle_message_call_count)); wlog("Exception thrown while terminating handle_message call #${count} task, ignoring",("count", handle_message_call_count));
} }
} }
_handle_message_calls_in_progress.clear();
try try
{ {

View file

@ -122,30 +122,4 @@ BOOST_AUTO_TEST_CASE( extended_public_key_type_test )
} }
} }
BOOST_AUTO_TEST_CASE( extension_serialization_test )
{
try
{
buyback_account_options bbo;
bbo.asset_to_buy = asset_id_type(1000);
bbo.asset_to_buy_issuer = account_id_type(2000);
bbo.markets.emplace( asset_id_type() );
bbo.markets.emplace( asset_id_type(777) );
account_create_operation create_op = make_account( "rex" );
create_op.registrar = account_id_type(1234);
create_op.extensions.value.buyback_options = bbo;
auto packed = fc::raw::pack( create_op );
account_create_operation unpacked = fc::raw::unpack<account_create_operation>(packed);
ilog( "original: ${x}", ("x", create_op) );
ilog( "unpacked: ${x}", ("x", unpacked) );
}
catch ( const fc::exception& e )
{
edump((e.to_detail_string()));
throw;
}
}
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()