0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-27 11:18:51 +02:00

ircd: Condition client timeout for longpoll; fix resource request reference.

This commit is contained in:
Jason Volk 2018-02-21 17:41:28 -08:00
parent 34d1ea4afc
commit 52cbf0fc70
3 changed files with 10 additions and 5 deletions

View file

@ -89,15 +89,15 @@ struct ircd::resource::request
http::query::string query;
string_view user_id; //m::user::id::buf user_id; //TODO: bleeding
string_view access_token;
string_view param[8];
vector_view<string_view> parv;
string_view param[8];
request(const http::request::head &head,
const string_view &content)
:json::object{content}
,head{head}
,content{content}
,query{head.query}
,query{this->head.query}
{}
request() = default;

View file

@ -242,9 +242,14 @@ ircd::client::async()
assert(bool(this->sock));
assert(bool(this->conf));
auto &sock(*this->sock);
const auto timeout
{
longpoll? seconds(-1) : conf->async_timeout
};
const net::wait_opts opts
{
net::ready::READ, conf->async_timeout
net::ready::READ, timeout
};
auto handler

View file

@ -572,7 +572,7 @@ ircd::resource::response::response(client &client,
const json::object &object,
const http::code &code)
{
static const auto content_type
static const string_view content_type
{
"application/json; charset=utf-8"
};
@ -585,7 +585,7 @@ ircd::resource::response::response(client &client,
const json::array &array,
const http::code &code)
{
static const auto content_type
static const string_view content_type
{
"application/json; charset=utf-8"
};