Skip to content

Commit

Permalink
istream/Pause: implement _FillBucketList()
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Aug 12, 2023
1 parent e8ae38d commit 28b065b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/istream/PauseIstream.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "ForwardIstream.hxx"
#include "UnusedPtr.hxx"
#include "New.hxx"
#include "Bucket.hxx"
#include "event/DeferEvent.hxx"

class PauseIstream final : public ForwardIstream {
Expand Down Expand Up @@ -59,6 +60,18 @@ class PauseIstream final : public ForwardIstream {
}
}

void _FillBucketList(IstreamBucketList &list) override {
if (resumed) {
defer_read.Cancel();
ForwardIstream::_FillBucketList(list);
} else {
list.SetMore();

/* we'll try again after Resume() gets called */
want_read = true;
}
}

int _AsFd() noexcept override {
return resumed
? ForwardIstream::_AsFd()
Expand Down

0 comments on commit 28b065b

Please sign in to comment.