Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 829

Show
Ignore:
Timestamp:
03/03/05 23:12:57 (4 years ago)
Author:
david
Message:

Fixed that broken pipe errors (clients disconnecting in mid-request) could bring down a fcgi process

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r828 r829  
    11*SVN* 
     2 
     3* Fixed that broken pipe errors (clients disconnecting in mid-request) could bring down a fcgi process 
    24 
    35* Added the original exception message to session recall errors (so you can see which class wasnt required) 
  • trunk/actionpack/lib/action_controller/cgi_process.rb

    r828 r829  
    121121      $stdout.binmode if $stdout.respond_to?(:binmode) 
    122122      $stdout.sync = false 
    123       print @cgi.header(@headers) 
     123       
     124      begin 
     125        print @cgi.header(@headers) 
    124126 
    125       if @cgi.send(:env_table)['REQUEST_METHOD'] == 'HEAD' 
    126         return 
    127       elsif @body.respond_to?(:call) 
    128         @body.call(self) 
    129       else 
    130         print @body 
     127        if @cgi.send(:env_table)['REQUEST_METHOD'] == 'HEAD' 
     128          return 
     129        elsif @body.respond_to?(:call) 
     130          @body.call(self) 
     131        else 
     132          print @body 
     133        end 
     134      rescue Errno::EPIPE => e 
     135        # lost connection to the FCGI process -- ignore the output, then 
    131136      end 
    132137    end