From 6f64e1b13364d630132a9697563d5b98f1593956 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Mon, 16 Jun 2025 18:51:59 +0200 Subject: [PATCH] libutil: make Fd{Sink,Source} io buffer shareable we will need this during RemoteStore wire asyncification to be able to use the old synchronous serializers. alternatively we could define all serializers on the async types as well, but that'd be slow and far too much unnecessarily duplicated code (that will be deleted soon anyway). Change-Id: I6e4f334025844b808a697ddcd8f80ddcd8c3fc9c --- lix/libutil/serialise.hh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lix/libutil/serialise.hh b/lix/libutil/serialise.hh index 80fe952dc..b7d4ffa40 100644 --- a/lix/libutil/serialise.hh +++ b/lix/libutil/serialise.hh @@ -125,6 +125,7 @@ struct FdSink : BufferedSink FdSink() : fd(-1) { } FdSink(int fd) : fd(fd) { } + FdSink(int fd, ref buffer) : BufferedSink(buffer), fd(fd) {} FdSink(const FdSink &) = delete; FdSink(FdSink &&) = delete; FdSink & operator=(const FdSink &) = delete; @@ -154,6 +155,7 @@ struct FdSource : BufferedSource FdSource() : fd(-1) { } FdSource(int fd) : fd(fd) { } + FdSource(int fd, ref buffer) : BufferedSource(buffer), fd(fd) {} FdSource(const FdSource &) = delete; FdSource(FdSource &&) = delete; FdSource & operator=(const FdSource &) = delete;