about summary refs log tree commit homepage
path: root/lib/yahns/wbuf_str.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/yahns/wbuf_str.rb')
-rw-r--r--lib/yahns/wbuf_str.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/yahns/wbuf_str.rb b/lib/yahns/wbuf_str.rb
index 414f3d5..b786a4c 100644
--- a/lib/yahns/wbuf_str.rb
+++ b/lib/yahns/wbuf_str.rb
@@ -3,12 +3,26 @@
 # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
 require_relative 'wbuf_common'
 
+# we only use this for buffering the tiniest responses (which are already
+# strings in memory and a handful of bytes).
+#
+#   "HTTP", "/1.1 "
+#   "HTTP/1.1 100 Continue\r\n\r\n"
+#   "100 Continue\r\n\r\nHTTP/1.1 "
+#
+# This is very, very rarely triggered.
+# 1) check_client_connection is enabled
+# 2) the client sent an "Expect: 100-continue" header
+#
+# Most output buffering goes through
+# the normal Yahns::Wbuf class which uses a temporary file as a buffer
+# (suitable for sendfile())
 class Yahns::WbufStr # :nodoc:
   include Yahns::WbufCommon
 
   def initialize(str, next_state)
     @str = str
-    @next = next_state # :check_client_connection, :http_100_response
+    @next = next_state # :ccc_done, :r100_done
   end
 
   def wbuf_flush(client)