public
Description: A very fast & simple Ruby web server
Homepage: http://code.macournoyer.com/thin/
Clone URL: git://github.com/macournoyer/thin.git
Search Repo:
Minimize GC in Headers & Doc fix.
macournoyer (author)
Wed Feb 06 10:01:20 -0800 2008
commit  2bad0690f53029129d3e512cde7eda66794651a2
tree    3641d646da73159932d232e820a645f6b497598e
parent  ab5f77d0156a7bc043278ef61cacf1765719d38a
...
1
2
3
4
5
6
...
 
 
 
1
2
3
0
@@ -1,6 +1,3 @@
0
-# This as been submitted to Rack as a patch, tested and everything.
0
-# Bug Christian Neukirchen at chneukirchen@gmail.com to apply the patch!
0
-
0
 require 'cgi'
0
 
0
 # Adapter to run a Rails app with any supported Rack handler.
...
1
2
 
 
 
 
 
3
4
5
6
7
8
9
 
10
11
12
...
1
2
3
4
5
6
7
8
9
10
11
12
13
 
14
15
16
17
0
@@ -1,12 +1,17 @@
0
 module Rack
0
   module Handler
0
+ # Rack Handler stricly to be able to use Thin through the rackup command.
0
+ # To do so, simply require 'thin' in your Rack config file and run like this
0
+ #
0
+ # rackup --server thin
0
+ #
0
     class Thin
0
       def self.run(app, options={})
0
         server = ::Thin::Server.new(options[:Host] || '0.0.0.0',
0
                                     options[:Port] || 8080,
0
                                     app)
0
         yield server if block_given?
0
- server.start!
0
+ server.start
0
       end
0
     end
0
   end
...
7
8
9
10
 
11
12
13
...
21
22
23
24
 
25
26
27
...
7
8
9
 
10
11
12
13
...
21
22
23
 
24
25
26
27
0
@@ -7,7 +7,7 @@
0
     
0
     def initialize
0
       @sent = {}
0
- @out = ''
0
+ @out = []
0
     end
0
     
0
     # Add <tt>key: value</tt> pair to the headers.
0
@@ -21,7 +21,7 @@
0
     end
0
     
0
     def to_s
0
- @out
0
+ @out.join
0
     end
0
   end
0
 end
...
114
115
116
117
 
118
119
120
...
135
136
137
138
 
139
140
141
...
114
115
116
 
117
118
119
120
...
135
136
137
 
138
139
140
141
0
@@ -114,7 +114,7 @@
0
     end
0
     alias :start! :start
0
     
0
- # == Gracefull shutdown.
0
+ # == Gracefull shutdown
0
     # Stops the server after processing all current connections.
0
     # As soon as this method is called, the server stops accepting
0
     # new requests and wait for all current connections to finish.
0
@@ -135,7 +135,7 @@
0
       end
0
     end
0
     
0
- # == Force shuting
0
+ # == Force shutdown
0
     # Stops the server closing all current connections right away.
0
     # This doesn't wait for connection to finish their work and send data.
0
     # All current requests will be dropped.

Comments

    No one has commented yet.