From cd50d183273c105a7f08b1875ba6f7a51d9f8e9a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 3 May 2019 10:34:08 +0000 Subject: bundle Danga::Socket and Sys::Syscall These modules are unmaintained upstream at the moment, but I'll be able to help with the intended maintainer once/if CPAN ownership is transferred. OTOH, we've been waiting for that transfer for several years, now... Changes I intend to make: * EPOLLEXCLUSIVE for Linux * remove unused fields wasting memory * kqueue bugfixes e.g. https://rt.cpan.org/Ticket/Display.html?id=116615 * accept4 support And some lower priority experiments: * switch to EV_ONESHOT / EPOLLONESHOT (incompatible changes) * nginx-style buffering to tmpfile instead of string array * sendfile off tmpfile buffers * io_uring maybe? --- lib/PublicInbox/HTTP.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/PublicInbox/HTTP.pm') diff --git a/lib/PublicInbox/HTTP.pm b/lib/PublicInbox/HTTP.pm index e73bd810..11bd241e 100644 --- a/lib/PublicInbox/HTTP.pm +++ b/lib/PublicInbox/HTTP.pm @@ -10,7 +10,7 @@ package PublicInbox::HTTP; use strict; use warnings; -use base qw(Danga::Socket); +use base qw(PublicInbox::DS); use fields qw(httpd env rbuf input_left remote_addr remote_port forward pull); use bytes (); # only for bytes::length use Fcntl qw(:seek); @@ -63,7 +63,7 @@ sub new ($$$) { $self; } -sub event_read { # called by Danga::Socket +sub event_read { # called by PublicInbox::DS my ($self) = @_; return event_read_input($self) if defined $self->{env}; @@ -148,7 +148,7 @@ sub app_dispatch { sysseek($input, 0, SEEK_SET) or die "BUG: psgi.input seek failed: $!"; } - # note: NOT $self->{sock}, we want our close (+ Danga::Socket::close), + # note: NOT $self->{sock}, we want our close (+ PublicInbox::DS::close), # to do proper cleanup: $env->{'psgix.io'} = $self; # only for ->close my $res = Plack::Util::run_app($self->{httpd}->{app}, $env); @@ -256,7 +256,7 @@ sub getline_cb ($$$) { if ($forward) { my $buf = eval { $forward->getline }; if (defined $buf) { - $write->($buf); # may close in Danga::Socket::write + $write->($buf); # may close in PublicInbox::DS::write unless ($self->{closed}) { my $next = $self->{pull}; if ($self->{write_buf_size}) { @@ -320,7 +320,7 @@ sub more ($$) { my $nlen = length($_[1]) - $n; return 1 if $nlen == 0; # all done! - # Danga::Socket::write queues the unwritten substring: + # PublicInbox::DS::write queues the unwritten substring: return $self->write(substr($_[1], $n, $nlen)); } } @@ -465,7 +465,7 @@ sub quit { $self->close; } -# callbacks for Danga::Socket +# callbacks for PublicInbox::DS sub event_hup { $_[0]->close } sub event_err { $_[0]->close } -- cgit v1.2.3-24-ge0c7