about summary refs log tree commit homepage
path: root/lib/PublicInbox
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-06-24 23:40:03 +0000
committerEric Wong <e@80x24.org>2016-06-25 00:19:37 +0000
commita2295236b67ae5bffd346a0b9590748db48ccd4e (patch)
tree491c99d7855c57b35c07f36fd04b1b9171598a5a /lib/PublicInbox
parent659b836f531caf75ec2ef6d64117386e655909e5 (diff)
downloadpublic-inbox-a2295236b67ae5bffd346a0b9590748db48ccd4e.tar.gz
This only affects Linux users with MSG_MORE support.

We can avoid extra TCP overhead for sub-optimal chunk sizes
by using MSG_MORE even with chunk trailers under Linux.

This breaks real-time apps which require <= 200ms latency for
streaming small packets (e.g. implementing "tail -F"), but the
public-inbox WWW code does not (and will never) do such things.
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r--lib/PublicInbox/HTTP.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/PublicInbox/HTTP.pm b/lib/PublicInbox/HTTP.pm
index c141fc89..e19c592c 100644
--- a/lib/PublicInbox/HTTP.pm
+++ b/lib/PublicInbox/HTTP.pm
@@ -223,7 +223,10 @@ sub chunked_wcb ($) {
                 return if $_[0] eq '';
                 more($self, sprintf("%x\r\n", bytes::length($_[0])));
                 more($self, $_[0]);
-                $self->write("\r\n");
+
+                # use $self->write("\n\n") if you care about real-time
+                # streaming responses, public-inbox WWW does not.
+                more($self, "\r\n");
         }
 }