Skip to content

Commit

Permalink
Remove queued HTTP handler registration
Browse files Browse the repository at this point in the history
websocketpp's socket handlers run at ultra-high priority which means they can beat registration of HTTP endpoints because they are queued via low priority.

No real reason needed to queue up registration of handlers at this point so just remove this queue
  • Loading branch information
spoonincode committed Jan 30, 2019
1 parent 0816381 commit bfd5e23
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions plugins/http_plugin/http_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,9 +560,7 @@ namespace eosio {

void http_plugin::add_handler(const string& url, const url_handler& handler) {
ilog( "add api url: ${c}", ("c",url) );
app().post(priority::low, [=](){
my->url_handlers.insert(std::make_pair(url,handler));
});
my->url_handlers.insert(std::make_pair(url,handler));
}

void http_plugin::handle_exception( const char *api_name, const char *call_name, const string& body, url_response_callback cb ) {
Expand Down

0 comments on commit bfd5e23

Please sign in to comment.