about summary refs log tree commit homepage
path: root/lib/PublicInbox/Listener.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-02-23 02:52:18 +0000
committerEric Wong <e@80x24.org>2016-02-23 03:44:20 +0000
commitdbaf64b646943bd92e1aa8d581e23a5adb4a3e57 (patch)
tree1281baf9597eab55dd8b5ed36508e7412a898d79 /lib/PublicInbox/Listener.pm
parente6085d1526b0948de16c145e11e511226126b7fa (diff)
downloadpublic-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.pm5
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);
         }
 }