From 231c19b5c925f1fd40910508a17d370352710e8d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 21 May 2016 23:45:27 +0000 Subject: http: support async_pass for Danga::Socket This will allow us to minimize buffering after we wait (possibly a long time) for readability. This also greatly reduces the amount of Danga::Socket-specific knowledge we have in our PSGI code, making it easier for others to understand. --- lib/PublicInbox/HTTPD/Async.pm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/PublicInbox/HTTPD') diff --git a/lib/PublicInbox/HTTPD/Async.pm b/lib/PublicInbox/HTTPD/Async.pm index bedb397d..ceba738e 100644 --- a/lib/PublicInbox/HTTPD/Async.pm +++ b/lib/PublicInbox/HTTPD/Async.pm @@ -21,10 +21,12 @@ sub new { $self; } +sub async_pass { $_[0]->{cb} = $_[1] } sub event_read { $_[0]->{cb}->() } sub event_hup { $_[0]->{cb}->() } sub event_err { $_[0]->{cb}->() } sub sysread { shift->{sock}->sysread(@_) } +sub getline { $_[0]->{sock}->getline }; sub close { my $self = shift; -- cgit v1.2.3-24-ge0c7