[OPTIM] http: set MSG_MORE on response when a pipelined request is pending
Many times we see a lot of short responses in HTTP (typically 304 on a
reload). It is a waste of network bandwidth to send that many small packets
when we know we can merge them. When we know that another HTTP request is
following a response, we set BF_EXPECT_MORE on the response buffer, which
will turn MSG_MORE on exactly once. That way, multiple short responses can
leave pipelined if their corresponding requests were also pipelined.
diff --git a/include/types/buffers.h b/include/types/buffers.h
index fd078fa..34189cd 100644
--- a/include/types/buffers.h
+++ b/include/types/buffers.h
@@ -112,6 +112,7 @@
#define BF_AUTO_CONNECT 0x800000 /* consumer may attempt to establish a new connection */
#define BF_DONT_READ 0x1000000 /* disable reading for now */
+#define BF_EXPECT_MORE 0x2000000 /* more data expected to be sent very soon (one-shoot) */
/* Use these masks to clear the flags before going back to lower layers */
#define BF_CLEAR_READ (~(BF_READ_NULL|BF_READ_PARTIAL|BF_READ_ERROR|BF_READ_ATTACHED))