mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
modules/media: Assert and condition remote download request isn't for my_host().
This commit is contained in:
parent
80743b2fd5
commit
7ea83597e5
1 changed files with 9 additions and 0 deletions
|
@ -162,6 +162,13 @@ download(const string_view &server,
|
|||
file_room_id(server, mediaid)
|
||||
};
|
||||
|
||||
thread_local char rembuf[256];
|
||||
if(remote && my_host(string(rembuf, remote)))
|
||||
return room_id;
|
||||
|
||||
if(!remote && my_host(server))
|
||||
return room_id;
|
||||
|
||||
download(server, mediaid, user_id, remote, room_id);
|
||||
return room_id;
|
||||
}
|
||||
|
@ -278,6 +285,8 @@ download(const mutable_buffer &head_buf,
|
|||
server::request::opts *const opts)
|
||||
{
|
||||
thread_local char rembuf[256];
|
||||
assert(remote || !my_host(server));
|
||||
assert(!remote || !my_host(string(rembuf, remote)));
|
||||
|
||||
if(!remote)
|
||||
remote = server;
|
||||
|
|
Loading…
Reference in a new issue