Rainbows! Rack HTTP server user/dev discussion
 help / color / Atom feed
5b2c74b8626c241f6d344bf4f1b49551c58f3080 blob 912 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
# -*- encoding: binary -*-
# :enddoc:
# non-portable body handling for Fiber-based concurrency goes here
# this module is required and included in worker processes only
# this is meant to be included _after_ Rainbows::Response::Body
module Rainbows::Fiber::Body # :nodoc:

  # the sendfile 1.1.0+ gem includes IO#trysendfile
  if IO.method_defined?(:trysendfile)
    def write_body_file(body, range)
      sock, n, body = to_io, nil, body_to_io(body)
      offset, count = range ? range : [ 0, body.stat.size ]
      case n = sock.trysendfile(body, offset, count)
      when Integer
        offset += n
        return if 0 == (count -= n)
      when :wait_writable
        kgio_wait_writable
      else # nil
        return
      end while true
      ensure
        close_if_private(body)
    end
  end

  def self.included(klass)
    klass.__send__ :alias_method, :write_body_stream, :write_body_each
  end
end
debug log:

solving 5b2c74b ...
found 5b2c74b in http://bogomips.org/rainbows.git

Rainbows! Rack HTTP server user/dev discussion

Archives are clonable:
	git clone --mirror http://bogomips.org/rainbows-public
	git clone --mirror http://ou63pmih66umazou.onion/rainbows-public

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.rainbows
	nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.rainbows

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git