From 14fffaeded71d1a251ad515df66173793fdd1c0c Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 10 Mar 2020 20:02:25 -0700 Subject: [PATCH] modules/media/media: Fix unnecessary remote stringifies. --- modules/media/media.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/media/media.cc b/modules/media/media.cc index 3e00987a8..caf6f3e94 100644 --- a/modules/media/media.cc +++ b/modules/media/media.cc @@ -221,8 +221,7 @@ ircd::m::media::file::download(const mxc &mxc, file::room_id(mxc) }; - thread_local char rembuf[256]; - if(remote && my_host(string(rembuf, remote))) + if(remote && my_host(remote)) return room_id; if(!remote && my_host(mxc.server)) @@ -293,7 +292,7 @@ try if(content_type != head.content_type) log::dwarning { log, "Server %s claims thumbnail %s is '%s' but we think it is '%s'", - string(remote), + remote, mxc.mediaid, head.content_type, content_type, @@ -321,12 +320,11 @@ try } catch(const ircd::server::unavailable &e) { - thread_local char rembuf[256]; throw m::error { http::BAD_GATEWAY, "M_MEDIA_UNAVAILABLE", "Server '%s' is not available for media for '%s/%s' :%s", - string(rembuf, remote), + remote, mxc.server, mxc.mediaid, e.what()