From 6b32da764d89fc024c76453c4b5062bd71ce3d95 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 20 Apr 2018 19:54:18 -0700 Subject: [PATCH] ircd::client: Remove the asynchronous longpoll state. --- include/ircd/client.h | 1 - ircd/client.cc | 13 ++----------- modules/console.cc | 3 --- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/include/ircd/client.h b/include/ircd/client.h index c2548feef..15eb8c3e1 100644 --- a/include/ircd/client.h +++ b/include/ircd/client.h @@ -50,7 +50,6 @@ struct ircd::client size_t head_length {0}; size_t content_consumed {0}; resource::request request; - bool longpoll {false}; size_t write_all(const const_buffer &); void close(const net::close_opts &, net::close_callback); diff --git a/ircd/client.cc b/ircd/client.cc index 5c1dc64c1..5f8216f15 100644 --- a/ircd/client.cc +++ b/ircd/client.cc @@ -325,9 +325,9 @@ ircd::client::async() assert(bool(this->sock)); assert(bool(this->conf)); auto &sock(*this->sock); - const auto timeout + const auto &timeout { - longpoll? seconds(-1) : conf->async_timeout + conf->async_timeout }; const net::wait_opts opts @@ -359,9 +359,6 @@ ircd::handle_client_ready(std::shared_ptr client, if(!handle_ec(*client, ec)) return; - if(client->longpoll) - return; - auto handler { std::bind(ircd::handle_client_request, std::move(client)) @@ -618,9 +615,6 @@ noexcept try if(!handle_request(pc)) return false; - if(longpoll) - return true; - // After the request, the head and content has been read off the socket // and the capstan has advanced to the end of the content. The catch is // that reading off the socket could have read too much, bleeding into @@ -896,9 +890,6 @@ ircd::client::discard_unconsumed(const http::request::head &head) if(unlikely(!sock)) return; - if(longpoll) - return; - const size_t unconsumed { head.content_length - content_consumed diff --git a/modules/console.cc b/modules/console.cc index c2e66b15f..57ce8e770 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -1580,9 +1580,6 @@ console_cmd__client(opt &out, const string_view &line) else out << " ASYNC"; - if(client->longpoll) - out << " POLL"; - if(client->request.user_id) out << " USER " << client->request.user_id;