Forum: Mongrel how do i cofigure in mongrel's http_request.rb

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
7fae7297a8d4735a2de48a8a77b10af4?d=identicon&s=25 Amit T. (amit-singh)
on 2010-10-06 10:47
Hi all ,
              Am looking to configure mongrels's http_request.rb in
order to
delete mongrel temporary file after upload .This is what i would like to

def initialize(params, socket, dispatchers)
      @params = params
      @socket = socket
      @dispatchers = dispatchers
      content_length = @params[Const::CONTENT_LENGTH].to_i
      remain = content_length - @params.http_body.length

      # tell all dispatchers the request has begun
      @dispatchers.each do |dispatcher|
      end unless @dispatchers.nil? || @dispatchers.empty?

      # Some clients (like FF1.0) report 0 for body and then send a
body.  This will probably truncate them but at least the request goes
through usually.
      if remain <= 0
        # we've got everything, pack it up
        @body =
        @body.write @params.http_body
        update_request_progress(0, content_length)
      elsif remain > 0
        # must read more data to complete body
        if remain > Const::MAX_BODY
          # huge body, put it in a tempfile
          @body =
          # small body, just use that
          @body =

        @body.write @params.http_body
        read_body(remain, content_length)

      @body.rewind if @body

Here i would like to close this @body after use by using something like
@body.close but while doing so am getting error what should i do and
whre should i call this @body.close
This topic is locked and can not be replied to.