0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-25 15:04:10 +01:00

modules/media/media: Fix unnecessary remote stringifies.

This commit is contained in:
Jason Volk 2020-03-10 20:02:25 -07:00
parent 52fc42c239
commit 14fffaeded

View file

@ -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()