unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
blob 79685c407b5d7615ec60b774621b655f6a723387 375 bytes (raw)
name: t/preread_input.ru 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
 
#\-E none
require 'digest/sha1'
require 'unicorn/preread_input'
use Rack::ContentLength
use Rack::ContentType, "text/plain"
use Unicorn::PrereadInput
nr = 0
run lambda { |env|
  $stderr.write "app dispatch: #{nr += 1}\n"
  input = env["rack.input"]
  dig = Digest::SHA1.new
  while buf = input.read(16384)
    dig.update(buf)
  end

  [ 200, {}, [ "#{dig.hexdigest}\n" ] ]
}

debug log:

solving 79685c4 ...
found 79685c4 in https://yhbt.net/unicorn.git/

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).