-sub event_read { $_[0]->{cb}->() }
-sub event_hup { $_[0]->{cb}->() }
-sub event_err { $_[0]->{cb}->() }
-sub sysread { shift->{sock}->sysread(@_) }
+# once this is called, all data we read is passed to the
+# to the PublicInbox::HTTP instance ($http) via $fh->write
+sub async_pass {
+ my ($self, $http, $fh, $bref) = @_;
+ # In case the client HTTP connection ($http) dies, it
+ # will automatically close this ($self) object.
+ $http->{forward} = $self;
+
+ # write anything we overread when we were reading headers
+ $fh->write($$bref); # PublicInbox:HTTP::{chunked,identity}_wcb
+
+ # we're done with this, free this memory up ASAP since the
+ # calls after this may use much memory:
+ $$bref = undef;
+
+ $self->{http} = $http;
+ $self->{fh} = $fh;