diff --git a/CMakeLists.txt b/CMakeLists.txt index 1bb41a58c6..1716b18bab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,6 +114,7 @@ else() set(Seastar_IO_URING ON CACHE BOOL "" FORCE) set(Seastar_SCHEDULING_GROUPS_COUNT 24 CACHE STRING "" FORCE) set(Seastar_UNUSED_RESULT_ERROR ON CACHE BOOL "" FORCE) + set(Seastar_OPENSSL OFF CACHE BOOL "" FORCE) # Match configure.py's build_seastar_shared_libs: Debug and Dev # build Seastar as a shared library, others build it static. if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "Dev") diff --git a/configure.py b/configure.py index b6241509fe..40487bae6c 100755 --- a/configure.py +++ b/configure.py @@ -2174,6 +2174,7 @@ def configure_seastar(build_dir, mode, mode_config, compiler_cache=None): '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DSeastar_SCHEDULING_GROUPS_COUNT=24', '-DSeastar_IO_URING=ON', + '-DSeastar_OPENSSL=OFF', ] if compiler_cache: diff --git a/seastar b/seastar index 4d268e0ef5..485a62b2c3 160000 --- a/seastar +++ b/seastar @@ -1 +1 @@ -Subproject commit 4d268e0ef5f597ff791f7a34af1b3d2cbe33c134 +Subproject commit 485a62b2c3eaf6de985bd1f304af1e77a4da653a diff --git a/test/boost/encrypted_file_test.cc b/test/boost/encrypted_file_test.cc index 262bd3f670..d928f491cc 100644 --- a/test/boost/encrypted_file_test.cc +++ b/test/boost/encrypted_file_test.cc @@ -578,9 +578,10 @@ static future<> test_random_data_source(std::vector sizes) { auto v1 = std::string_view(read_buff.get(), size_to_compare); auto v2 = std::string_view(unified_buff.get() + pos, size_to_compare); BOOST_REQUIRE_EQUAL(v1, v2); + pos += size_to_compare; auto skip = unified_buff.size() - pos > 4113 ? 4097 : (unified_buff.size() - pos)/2; co_await encrypted_source.skip(skip); - pos += size_to_compare + skip; + pos += skip; } co_await encrypted_source.close(); } catch (...) { diff --git a/test/boost/gcp_object_storage_test.cc b/test/boost/gcp_object_storage_test.cc index 6c7b5c0e5f..92eaff9164 100644 --- a/test/boost/gcp_object_storage_test.cc +++ b/test/boost/gcp_object_storage_test.cc @@ -232,8 +232,26 @@ SEASTAR_FIXTURE_TEST_CASE(test_gcp_storage_skip_read, local_gcs_wrapper, *check_ auto rem = file_size - pos; auto skip = tests::random::get_int(std::min(rem, size_t(100)), rem); auto read = std::min(rem - skip, size_t(tests::random::get_int(31, 2048))); - co_await is1.skip(skip); - co_await is2.skip(skip); + + // Both streams may throw "premature end of stream" when + // skipping past EOF. Verify they agree and exit the loop. + auto is_premature_eof = [] (seastar::future<>&& f) { + try { + f.get(); + return false; + } catch (const std::runtime_error& e) { + if (std::string_view(e.what()).find("premature end of stream") != std::string_view::npos) { + return true; + } + throw; + } + }; + bool is1_eof = co_await is1.skip(skip).then_wrapped(is_premature_eof); + bool is2_eof = co_await is2.skip(skip).then_wrapped(is_premature_eof); + BOOST_REQUIRE_EQUAL(is1_eof, is2_eof); + if (is1_eof) { + break; + } auto b1 = co_await is1.read_exactly(read); auto b2 = co_await is2.read_exactly(read); diff --git a/utils/gcp/object_storage.cc b/utils/gcp/object_storage.cc index 1e90d01212..3a009efd2e 100644 --- a/utils/gcp/object_storage.cc +++ b/utils/gcp/object_storage.cc @@ -794,7 +794,13 @@ future> utils::gcp::storage::client::object_data_source:: auto buf_size = buffer_size(); assert(buf_size <= _position); auto read_pos = _position - buf_size; - co_await seek(read_pos + n); + auto new_pos = read_pos + n; + co_await seek(new_pos); + // seek() clamps position to _size, so if the requested + // position exceeds _size we are skipping past EOF. + if (new_pos > _size) { + throw std::runtime_error("premature end of stream"); + } // And get the next buffer co_return co_await get(); } diff --git a/utils/rest/client.cc b/utils/rest/client.cc index 446645e9ef..709052e2a9 100644 --- a/utils/rest/client.cc +++ b/utils/rest/client.cc @@ -248,33 +248,11 @@ future<> rest::send_request(std::string_view uri constexpr auto linesep = '\n'; -auto -fmt::formatter::format(const rest::httpclient::request_type& r, fmt::format_context& ctx) const -> decltype(ctx.out()) { - auto os = fmt::format_to(ctx.out(), "{} {} HTTP/{}{}", r._method, r._url, r._version, linesep); - for (auto& [k, v] : r._headers) { - os = fmt::format_to(os, "{}: {}{}", k, v, linesep); - } - os = fmt::format_to(os, "{}{}", linesep, r.content); - return os; -} - auto fmt::formatter::format(const rest::httpclient::result_type& r, fmt::format_context& ctx) const -> decltype(ctx.out()) { return fmt::format_to(ctx.out(), "{}", r.reply); } -auto -fmt::formatter::format(const seastar::http::reply& r, fmt::format_context& ctx) const -> decltype(ctx.out()) { - auto s = r.response_line(); - // remove the trailing \r\n from response_line string. we want our own linebreak, hence substr. - auto os = fmt::format_to(ctx.out(), "{}{}", std::string_view(s).substr(0, s.size()-2), linesep); - for (auto& [k, v] : r._headers) { - os = fmt::format_to(os, "{}: {}{}", k, v, linesep); - } - os = fmt::format_to(os, "{}{}", linesep, r._content); - return os; -} - auto fmt::formatter::format(const rest::redacted_request_type& rr, fmt::format_context& ctx) const -> decltype(ctx.out()) { const auto& r = rr.original; diff --git a/utils/rest/client.hh b/utils/rest/client.hh index 8be241587f..85e0379c32 100644 --- a/utils/rest/client.hh +++ b/utils/rest/client.hh @@ -197,11 +197,6 @@ future<> send_request(std::string_view uri } -template <> -struct fmt::formatter : fmt::formatter { - auto format(const rest::httpclient::request_type&, fmt::format_context& ctx) const -> decltype(ctx.out()); -}; - template <> struct fmt::formatter : fmt::formatter { auto format(const rest::httpclient::result_type&, fmt::format_context& ctx) const -> decltype(ctx.out()); @@ -216,8 +211,3 @@ template <> struct fmt::formatter : fmt::formatter { auto format(const rest::redacted_result_type&, fmt::format_context& ctx) const -> decltype(ctx.out()); }; - -template <> -struct fmt::formatter : fmt::formatter { - auto format(const seastar::http::reply&, fmt::format_context& ctx) const -> decltype(ctx.out()); -};