# File lib/mongrel.rb, line 67 67: def initialize(params, initial_body, socket) 68: @body = initial_body || "" 69: @params = params 70: @socket = socket 71: 72: # fix up the CGI requirements 73: params['CONTENT_LENGTH'] = params['HTTP_CONTENT_LENGTH'] || 0 74: 75: # now, if the initial_body isn't long enough for the content length we have to fill it 76: # TODO: adapt for big ass stuff by writing to a temp file 77: clen = params['HTTP_CONTENT_LENGTH'].to_i 78: if @body.length < clen 79: @body << @socket.read(clen - @body.length) 80: end 81: end