diff options
-rw-r--r-- | examples/the_metal.rb | 4 | ||||
-rw-r--r-- | lib/yahns/the_metal.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/examples/the_metal.rb b/examples/the_metal.rb index 94b4ef0..b88a665 100644 --- a/examples/the_metal.rb +++ b/examples/the_metal.rb @@ -5,13 +5,13 @@ require 'the_metal' # based on README.markdown in git://github.com/tenderlove/the_metal.git class Application - def serve req, res + def call req, res # TODO: to support persistent connections, we must have Content-Length # when write_head is called or have Transfer-Encoding: chunked # (in which case res.write must chunk for us) res.write_head 200, 'Content-Type' => 'text/plain' res.write "Hello World\n" - res.close + res.finish end end diff --git a/lib/yahns/the_metal.rb b/lib/yahns/the_metal.rb index 55621ec..4d96bb7 100644 --- a/lib/yahns/the_metal.rb +++ b/lib/yahns/the_metal.rb @@ -69,7 +69,7 @@ class Yahns::TheMetal # :nodoc: req = TheMetal::Request.new(env) out = OutSock.new(self, persist) res = TheMetal::Response.new(200, headers, out) - k.app.serve(req, res) # may raise during OutSock#write + k.app.call(req, res) # may raise during OutSock#write if wbuf = out.wbuf # we may need to wait for writability: |