From 21a6ec5e926ddf0746bcf2a299aee189365c67a1 Mon Sep 17 00:00:00 2001 From: zedshaw Date: Mon, 20 Nov 2006 16:51:42 +0000 Subject: More testing code for the cgi carver. Not ready yet. git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@396 19e92222-5c0b-0410-8929-a290d50e31e9 --- lib/mongrel.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/mongrel.rb') diff --git a/lib/mongrel.rb b/lib/mongrel.rb index 4df0e3f..4e94f0a 100644 --- a/lib/mongrel.rb +++ b/lib/mongrel.rb @@ -9,7 +9,7 @@ $mongrel_debug_client = false require 'socket' require 'http11' require 'tempfile' -require 'thread' +require 'fastthread' require 'stringio' require 'mongrel/cgi' require 'mongrel/handlers' @@ -200,6 +200,7 @@ module Mongrel @mpart_type, @mpart_boundary = @params['CONTENT_TYPE'].split(/;\s*/) if @mpart_type and @mpart_boundary and @mpart_boundary.include? "=" @mpart_boundary = @mpart_boundary.split("=")[1].strip + STDERR.puts "boundary: #{@mpart_boundary}" @params['MULTIPART_TYPE'] = @mpart_type @params['MULTIPART_BOUNDARY'] = @mpart_boundary @search = BMHSearch.new(@mpart_boundary, 100) @@ -230,11 +231,12 @@ module Mongrel read_body(remain, content_length, dispatcher) end - if @search + if @search and @body + STDERR.puts "number of boundaries: #{@search.nfound}" @body.rewind @search.pop.each do |boundary| - @body.seek(boundary) - STDERR.puts "BOUNDARY at #{boundary}: #{@body.readline}" + @body.seek(boundary - 2) + STDERR.puts "BOUNDARY at #{boundary}: #{@body.read(@mpart_boundary.length + 2)}" end end -- cgit v1.2.3-24-ge0c7