Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 344
- Log:
Massive changeset which brings the old, ROOL customised Instiki
version up to date, but without any ROOL customisations in this
latest checked-in version (which is 0.19.1). This is deliberate,
so that it's easy to see the changes made for the ROOL version
in a subsequent changeset. The 'app/views/shared' directory is not
part of Instiki but is kept to maintain the change history with
updated ROOL customisations, some of which involve the same files
in that same directory.
- Author:
- rool
- Date:
- Sat Mar 19 19:52:13 +0000 2011
- Size:
- 2408 Bytes
1 | require 'webrick' |
2 | require 'stringio' |
3 | require 'rack/content_length' |
4 | require 'tempfile' |
5 | |
6 | module Rack |
7 | module Handler |
8 | class WEBrick < ::WEBrick::HTTPServlet::AbstractServlet |
9 | def self.run(app, options={}) |
10 | options[:BindAddress] = options.delete(:Host) if options[:Host] |
11 | @server = ::WEBrick::HTTPServer.new(options) |
12 | @server.mount "/", Rack::Handler::WEBrick, app |
13 | trap(:INT) { @server.shutdown } |
14 | trap(:TERM) { @server.shutdown } |
15 | yield @server if block_given? |
16 | @server.start |
17 | end |
18 | end |
19 | end |
20 | |
21 | if Rack.release <= "1.2" |
22 | # The Tempfile bug is fixed in the bundled version of Rack |
23 | class RewindableInput |
24 | def make_rewindable |
25 | # Buffer all data into a tempfile. Since this tempfile is private to this |
26 | # RewindableInput object, we chmod it so that nobody else can read or write |
27 | # it. On POSIX filesystems we also unlink the file so that it doesn't |
28 | # even have a file entry on the filesystem anymore, though we can still |
29 | # access it because we have the file handle open. |
30 | @rewindable_io = Tempfile.new('RackRewindableInput') |
31 | @rewindable_io.chmod(0000) |
32 | @rewindable_io.set_encoding(Encoding::BINARY) if @rewindable_io.respond_to?(:set_encoding) |
33 | @rewindable_io.binmode |
34 | if filesystem_has_posix_semantics? && !tempfile_unlink_contains_bug? |
35 | @rewindable_io.unlink |
36 | @unlinked = true |
37 | end |
38 | |
39 | buffer = "" |
40 | while @io.read(1024 * 4, buffer) |
41 | entire_buffer_written_out = false |
42 | while !entire_buffer_written_out |
43 | written = @rewindable_io.write(buffer) |
44 | entire_buffer_written_out = written == Rack::Utils.bytesize(buffer) |
45 | if !entire_buffer_written_out |
46 | buffer.slice!(0 .. written - 1) |
47 | end |
48 | end |
49 | end |
50 | @rewindable_io.rewind |
51 | end |
52 | |
53 | def tempfile_unlink_contains_bug? |
54 | # The tempfile library as included in Ruby 1.9.1-p152 and later |
55 | # contains a bug: unlinking an open Tempfile object also closes |
56 | # it, which breaks our expected POSIX semantics. This problem |
57 | # has been fixed in Ruby 1.9.2, but the Ruby team chose not to |
58 | # include the bug fix in later versions of the 1.9.1 series. |
59 | ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby" |
60 | ruby_engine == "ruby" && RUBY_VERSION == "1.9.1" && RUBY_PATCHLEVEL >= 152 |
61 | end |
62 | end |
63 | end |
64 | |
65 | end |