switch to coroutine execution model

This commit is contained in:
Martin Michelsen
2025-04-30 21:43:06 -07:00
parent f65b1f1c14
commit cc99050964
160 changed files with 269127 additions and 227736 deletions
+4 -5
View File
@@ -1,6 +1,5 @@
#pragma once
#include <event2/bufferevent.h>
#include <inttypes.h>
#include <functional>
@@ -56,13 +55,13 @@ RetT& check_size_generic(
size_t min_size,
size_t max_size) {
if (size < min_size) {
throw std::runtime_error(phosg::string_printf(
"command too small (expected at least 0x%zX bytes, received 0x%zX bytes)",
throw std::runtime_error(std::format(
"command too small (expected at least 0x{:X} bytes, received 0x{:X} bytes)",
min_size, size));
}
if (size > max_size) {
throw std::runtime_error(phosg::string_printf(
"command too large (expected at most 0x%zX bytes, received 0x%zX bytes)",
throw std::runtime_error(std::format(
"command too large (expected at most 0x{:X} bytes, received 0x{:X} bytes)",
max_size, size));
}
return *reinterpret_cast<RetT*>(data);