From 499e725e73c242db34ef00bc3925d387eaf09950 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 4 Sep 2018 20:34:10 -0700 Subject: [PATCH] modules/media/media: Add conf item for download timeout. --- modules/media/media.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/media/media.cc b/modules/media/media.cc index d26a97724..d875397f3 100644 --- a/modules/media/media.cc +++ b/modules/media/media.cc @@ -214,6 +214,13 @@ catch(const ircd::server::unavailable &e) }; } +conf::item +media_download_timeout +{ + { "name", "ircd.media.download.timeout" }, + { "default", 15L }, +}; + std::pair> download(const mutable_buffer &head_buf, const string_view &server, @@ -253,8 +260,7 @@ download(const mutable_buffer &head_buf, remote, { out_head }, { in_head, in_content }, opts }; - //TODO: conf - if(!remote_request.wait(seconds(10), std::nothrow)) + if(!remote_request.wait(seconds(media_download_timeout), std::nothrow)) throw http::error { http::REQUEST_TIMEOUT