#72 ✓resolved
D.Mann

[PATCH] Rack::Handler::FastCGI is not compatible with the pure ruby FCGI module

Reported by D.Mann | August 12th, 2009 @ 09:07 PM

FCGI will use pure ruby if:

  1. FCGI_PURE_RUBY is set to true before the fcgi library is loaded
  2. The C version of FCGI doesn't load (lib not found or the like)

The class FCGI::Stream does not exist in the pure ruby version of the FCGI module. Rack::Handler::FastCGI tries to override the FCGI::Stream.read() method, but will fails with the following error:

undefined method read' for classFCGI::Stream' (NameError)

My patch checks that the FCGI::Stream class exists, before trying to override the read method. It is committed here:

http://github.com/dmann/rack/commit/c87b7cfdf0f978062acc7d63ebd0a1c...

And it basically amounts to:

+if FCGI.const_defined? "Stream" class FCGI::Stream

 alias _rack_read_without_buffer read
 def read(n, buffer=nil)
   buf = _rack_read_without_buffer n
   buffer.replace(buf.to_s)  if buffer
   buf
 end

end +end

This is also related to the following ticket:

http://rack.lighthouseapp.com/projects/22435-rack/tickets/61

Comments and changes to this ticket

  • josh

    josh December 11th, 2009 @ 02:43 AM

    • Assigned user set to “josh”
    • State changed from “new” to “wontfix”

    Is this still a problem and is the patch still good?

    Let me know and I'll reopen the ticket and commit the patch.

    (wonfixing cause I don't have a stale option)

  • josh

    josh December 11th, 2009 @ 02:50 AM

    • State changed from “wontfix” to “resolved”

    nvm, this was already commited f22a0818cbc06be23fab1e0246c226af058b56bc

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Tags

Pages