server: pass sexp-commmands through store worker

To ensure all Xapian rw commands happen in the same thread.
This commit is contained in:
Dirk-Jan C. Binnema
2024-05-27 23:02:42 +03:00
parent f2f01595a5
commit 697d6b6b4f
2 changed files with 60 additions and 15 deletions

View File

@ -79,11 +79,12 @@ cookie(size_t n)
::printf(COOKIE_PRE "%x" COOKIE_POST, num);
}
static void
output_stdout(const std::string& str, Server::OutputFlags flags)
{
// Note: with the StoreWorker, we _always_ need to flush
flags |= Server::OutputFlags::Flush;
cookie(str.size() + 1);
if (G_UNLIKELY(::puts(str.c_str()) < 0)) {
mu_critical("failed to write output '{}'", str);