# File lib/mongrel.rb, line 228
    def read_body(remain, total, dispatcher)
      begin
        # write the odd sized chunk first

        remain -= @body.write(read_socket(remain % Const::CHUNK_SIZE))
        dispatcher.request_progress(params, remain, total) if dispatcher

        # then stream out nothing but perfectly sized chunks
        until remain <= 0 or @socket.closed?
          remain -= @body.write(read_socket(Const::CHUNK_SIZE))
          # ASSUME: we are writing to a disk and these writes always write the requested amount
          dispatcher.request_progress(params, remain, total) if dispatcher
        end
      rescue Object
        STDERR.puts "ERROR reading http body: #$!"
        $!.backtrace.join("\n")
        # any errors means we should delete the file, including if the file is dumped
        @socket.close rescue Object
        @body.delete if @body.class == Tempfile
        @body = nil # signals that there was a problem
      end
    end