public
Fork of macournoyer/thin
Description: A very fast & simple Ruby web server
Homepage: http://code.macournoyer.com/thin/
Clone URL: git://github.com/raggi/thin.git
Fixed a crash on bad requests, minor code format corrections
raggi (author)
Tue Jul 15 06:09:38 -0700 2008
commit  57967535f061c16c537a08652813107835950576
tree    79867cdf030991e7a068b76cb353d09c6848a991
parent  e1bfbe8c4202606e27d00ecb2fed2bf2ae4554b4
...
59
60
61
62
 
63
64
65
66
67
68
69
 
70
71
72
...
100
101
102
103
 
104
105
106
...
113
114
115
116
 
117
118
119
120
121
 
122
123
124
...
59
60
61
 
62
63
64
65
66
67
68
 
69
70
71
72
...
100
101
102
 
103
104
105
106
...
113
114
115
 
116
117
118
119
120
 
121
122
123
124
0
@@ -59,14 +59,14 @@ module Thin
0
       @request.remote_address = remote_address
0
 
0
       # TODO - remove excess documentation / move it somewhere more sensible.
0
- # (interface specs!) - (rack)
0
+ # (interface specs!) - (rack)
0
       
0
       # Connection may be closed unless the App#call response was a [100, ...]
0
       # It should be noted that connection objects will linger until this
0
       # callback is no longer referenced, so be tidy!
0
       @request.env['async.callback'] = method(:post_process)
0
       
0
- # When we're under a non-async framework like rails, we can still spawn
0
+ # When we're under a non-async framework like rails, we can still spawn
0
       # off async responses using the callback info, so there's little point
0
       # in removing this.
0
       response = AsyncResponse
0
@@ -100,7 +100,7 @@ module Thin
0
       
0
       unless persistent?
0
         # If the body is deferred, then close_connection needs to happen after
0
- # the last chunk has been sent.
0
+ # the last chunk has been sent.
0
         if @response.body.kind_of?(EventMachine::Deferrable)
0
           @response.body.callback { close_connection_after_writing }
0
           @response.body.errback { close_connection_after_writing }
0
@@ -113,12 +113,12 @@ module Thin
0
     rescue Object
0
       handle_error
0
     ensure
0
- # If the body is being deferred, then terminate afterward.
0
+ # If the body is being deferred, then terminate afterward.
0
       if @response.body.kind_of?(EventMachine::Deferrable)
0
         @response.body.callback { terminate_request }
0
       else
0
         # Don't terminate the response if we're going async.
0
- terminate_request unless result.first == 100
0
+ terminate_request unless result && result.first == 100
0
       end
0
     end
0
     

Comments

    No one has commented yet.