mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 07:23:53 +01:00
modules/media/media: Fix unnecessary remote stringifies.
This commit is contained in:
parent
52fc42c239
commit
14fffaeded
1 changed files with 3 additions and 5 deletions
|
@ -221,8 +221,7 @@ ircd::m::media::file::download(const mxc &mxc,
|
||||||
file::room_id(mxc)
|
file::room_id(mxc)
|
||||||
};
|
};
|
||||||
|
|
||||||
thread_local char rembuf[256];
|
if(remote && my_host(remote))
|
||||||
if(remote && my_host(string(rembuf, remote)))
|
|
||||||
return room_id;
|
return room_id;
|
||||||
|
|
||||||
if(!remote && my_host(mxc.server))
|
if(!remote && my_host(mxc.server))
|
||||||
|
@ -293,7 +292,7 @@ try
|
||||||
if(content_type != head.content_type) log::dwarning
|
if(content_type != head.content_type) log::dwarning
|
||||||
{
|
{
|
||||||
log, "Server %s claims thumbnail %s is '%s' but we think it is '%s'",
|
log, "Server %s claims thumbnail %s is '%s' but we think it is '%s'",
|
||||||
string(remote),
|
remote,
|
||||||
mxc.mediaid,
|
mxc.mediaid,
|
||||||
head.content_type,
|
head.content_type,
|
||||||
content_type,
|
content_type,
|
||||||
|
@ -321,12 +320,11 @@ try
|
||||||
}
|
}
|
||||||
catch(const ircd::server::unavailable &e)
|
catch(const ircd::server::unavailable &e)
|
||||||
{
|
{
|
||||||
thread_local char rembuf[256];
|
|
||||||
throw m::error
|
throw m::error
|
||||||
{
|
{
|
||||||
http::BAD_GATEWAY, "M_MEDIA_UNAVAILABLE",
|
http::BAD_GATEWAY, "M_MEDIA_UNAVAILABLE",
|
||||||
"Server '%s' is not available for media for '%s/%s' :%s",
|
"Server '%s' is not available for media for '%s/%s' :%s",
|
||||||
string(rembuf, remote),
|
remote,
|
||||||
mxc.server,
|
mxc.server,
|
||||||
mxc.mediaid,
|
mxc.mediaid,
|
||||||
e.what()
|
e.what()
|
||||||
|
|
Loading…
Reference in a new issue