about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-12-22 07:29:17 +0000
committerEric Wong <e@80x24.org>2016-12-22 07:33:42 +0000
commit15e14f11af0b9919f11e0c186b365ae0154e7e77 (patch)
tree05a8346fde4d56cae22be1001b5235fbf9e4f77e /lib
parent90b3d23352a0c37680ac266acaf4fef73a781bc9 (diff)
downloadpublic-inbox-15e14f11af0b9919f11e0c186b365ae0154e7e77.tar.gz
Notes for future developers (myself included) since we
can't assume people can read my mind.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/GitHTTPBackend.pm2
-rw-r--r--lib/PublicInbox/HTTPD.pm2
-rw-r--r--lib/PublicInbox/Listener.pm6
3 files changed, 8 insertions, 2 deletions
diff --git a/lib/PublicInbox/GitHTTPBackend.pm b/lib/PublicInbox/GitHTTPBackend.pm
index 1987a013..a069fd94 100644
--- a/lib/PublicInbox/GitHTTPBackend.pm
+++ b/lib/PublicInbox/GitHTTPBackend.pm
@@ -227,7 +227,7 @@ sub serve_smart {
                 $r->[0] == 403 ? serve_dumb($env, $git, $path) : $r;
         };
         my $res;
-        my $async = $env->{'pi-httpd.async'};
+        my $async = $env->{'pi-httpd.async'}; # XXX unstable API
         my $io = $env->{'psgix.io'};
         my $cb = sub {
                 my $r = $rd_hdr->() or return;
diff --git a/lib/PublicInbox/HTTPD.pm b/lib/PublicInbox/HTTPD.pm
index 433d6da7..fb476624 100644
--- a/lib/PublicInbox/HTTPD.pm
+++ b/lib/PublicInbox/HTTPD.pm
@@ -29,6 +29,8 @@ sub new {
                 'psgi.multiprocess' => Plack::Util::TRUE,
                 'psgix.harakiri'=> Plack::Util::FALSE,
                 'psgix.input.buffered' => Plack::Util::TRUE,
+
+                # XXX unstable API!
                 'pi-httpd.async' => do {
                         no warnings 'once';
                         *pi_httpd_async
diff --git a/lib/PublicInbox/Listener.pm b/lib/PublicInbox/Listener.pm
index 5f351a77..a3a2015b 100644
--- a/lib/PublicInbox/Listener.pm
+++ b/lib/PublicInbox/Listener.pm
@@ -13,7 +13,7 @@ require IO::Handle;
 sub new ($$$) {
         my ($class, $s, $cb) = @_;
         setsockopt($s, SOL_SOCKET, SO_KEEPALIVE, 1);
-        setsockopt($s, IPPROTO_TCP, TCP_NODELAY, 1);
+        setsockopt($s, IPPROTO_TCP, TCP_NODELAY, 1); # ignore errors on non-TCP
         listen($s, 1024);
         IO::Handle::blocking($s, 0);
         my $self = fields::new($class);
@@ -26,8 +26,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
+        # XXX our event loop needs better granularity for
+        # a single accept() here to be, umm..., acceptable
+        # on high-traffic sites.
         if (my $addr = accept(my $c, $sock)) {
                 IO::Handle::blocking($c, 0); # no accept4 :<
                 $self->{post_accept}->($c, $addr, $sock);