mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 02:02:38 +01:00
ircd:Ⓜ️:media::file: Fix illegal context switch; mask interruption.
This commit is contained in:
parent
f301d6641c
commit
61248a4c5b
1 changed files with 11 additions and 9 deletions
|
@ -124,17 +124,13 @@ try
|
||||||
if(size(content) >= size_t(journal_threshold))
|
if(size(content) >= size_t(journal_threshold))
|
||||||
vmopts.wopts.sopts.journal = false;
|
vmopts.wopts.sopts.journal = false;
|
||||||
|
|
||||||
const m::room room
|
const ctx::uninterruptible::nothrow ui;
|
||||||
|
auto room
|
||||||
{
|
{
|
||||||
room_id, &vmopts
|
create(room_id, user_id, "file")
|
||||||
};
|
};
|
||||||
|
|
||||||
create(room, user_id, "file");
|
room.copts = &vmopts;
|
||||||
const unwind_exceptional purge{[&room]
|
|
||||||
{
|
|
||||||
m::room::purge{room};
|
|
||||||
}};
|
|
||||||
|
|
||||||
const size_t written
|
const size_t written
|
||||||
{
|
{
|
||||||
file::write(room, user_id, content, content_type)
|
file::write(room, user_id, content, content_type)
|
||||||
|
@ -308,6 +304,7 @@ try
|
||||||
}
|
}
|
||||||
catch(const std::exception &e)
|
catch(const std::exception &e)
|
||||||
{
|
{
|
||||||
|
const ctx::exception_handler eh;
|
||||||
log::error
|
log::error
|
||||||
{
|
{
|
||||||
log, "File writing %s by %s type:%s len:%zu :%s",
|
log, "File writing %s by %s type:%s len:%zu :%s",
|
||||||
|
@ -318,7 +315,12 @@ catch(const std::exception &e)
|
||||||
e.what(),
|
e.what(),
|
||||||
};
|
};
|
||||||
|
|
||||||
throw;
|
m::room::purge
|
||||||
|
{
|
||||||
|
room.room_id
|
||||||
|
};
|
||||||
|
|
||||||
|
std::rethrow_exception(eh);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
|
|
Loading…
Reference in a new issue