diff --git a/include/cinatra/ylt/coro_io/coro_file.hpp b/include/cinatra/ylt/coro_io/coro_file.hpp index fa42b79f..3ea8b850 100644 --- a/include/cinatra/ylt/coro_io/coro_file.hpp +++ b/include/cinatra/ylt/coro_io/coro_file.hpp @@ -270,6 +270,7 @@ class coro_file { async_simple::coro::Lazy> async_read_at( uint64_t offset, char* data, size_t size) { assert(stream_file_); + assert(type_ == read_type::uring_random); auto [ec, read_size] = co_await coro_io::async_read_at( offset, @@ -288,6 +289,7 @@ class coro_file { const char* data, size_t size) { assert(stream_file_); + assert(type_ == read_type::uring_random); auto [ec, write_size] = co_await coro_io::async_write_at( offset, @@ -299,6 +301,7 @@ class coro_file { async_simple::coro::Lazy> async_read( char* data, size_t size) { assert(stream_file_); + assert(type_ == read_type::uring); auto [ec, read_size] = co_await coro_io::async_read( *reinterpret_cast(stream_file_.get()), @@ -314,6 +317,7 @@ class coro_file { async_simple::coro::Lazy async_write(const char* data, size_t size) { assert(stream_file_); + assert(type_ == read_type::uring); auto [ec, write_size] = co_await coro_io::async_write( *reinterpret_cast(stream_file_.get()),