diff options
author | Eric Wong <e@80x24.org> | 2016-02-23 02:52:18 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-02-23 03:44:20 +0000 |
commit | dbaf64b646943bd92e1aa8d581e23a5adb4a3e57 (patch) | |
tree | 1281baf9597eab55dd8b5ed36508e7412a898d79 /lib/PublicInbox/Listener.pm | |
parent | e6085d1526b0948de16c145e11e511226126b7fa (diff) | |
download | public-inbox-dbaf64b646943bd92e1aa8d581e23a5adb4a3e57.tar.gz |
This is meant to provide an easy starting point for server admins. It provides a basic HTTP server for admins unfamiliar with configuring PSGI applications as well as being an identical interface for management as our nntpd implementation. This HTTP server may also be a generic Plack/PSGI server for existing Plack/PSGI applications.
Diffstat (limited to 'lib/PublicInbox/Listener.pm')
-rw-r--r-- | lib/PublicInbox/Listener.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/PublicInbox/Listener.pm b/lib/PublicInbox/Listener.pm index 8e0554f3..5f351a77 100644 --- a/lib/PublicInbox/Listener.pm +++ b/lib/PublicInbox/Listener.pm @@ -25,11 +25,12 @@ sub new ($$$) { sub event_read { my ($self) = @_; + my $sock = $self->{sock}; # no loop here, we want to fairly distribute clients # between multiple processes sharing the same socket - if (my $addr = accept(my $c, $self->{sock})) { + if (my $addr = accept(my $c, $sock)) { IO::Handle::blocking($c, 0); # no accept4 :< - $self->{post_accept}->($c, $addr); + $self->{post_accept}->($c, $addr, $sock); } } |