]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/amf_controller.rb
Rework AMF controller's streaming output for rails 3
[rails.git] / app / controllers / amf_controller.rb
index e776c8d8b30c89b22f2f63e3d88585fcd04d9d2e..96d3602a9219013ca1fc0a2fd29ae1484a7c51fd 100644 (file)
@@ -66,7 +66,10 @@ class AmfController < ApplicationController
       end
 
       bodies=AMF.getint(req)            # Read number of bodies
-      render :content_type => "application/x-amf", :text => proc { |response, output| 
+
+      self.status = :ok
+      self.content_type = Mime::AMF
+      self.response_body = proc { |response, output| 
         a,b=bodies.divmod(256)
         output.write 0.chr+0.chr+0.chr+0.chr+a.chr+b.chr
         bodies.times do                 # Read each body
@@ -114,7 +117,10 @@ class AmfController < ApplicationController
       end
 
       bodies=AMF.getint(req)          # Read number of bodies
-      render :content_type => "application/x-amf", :text => proc { |response, output| 
+
+      self.status = :ok
+      self.content_type = Mime::AMF
+      self.response_body = proc { |response, output| 
         a,b=bodies.divmod(256)
         output.write 0.chr+0.chr+0.chr+0.chr+a.chr+b.chr
         bodies.times do               # Read each body