Changeset 189
- Timestamp:
- 03/22/2007 23:55:43 (20 months ago)
- Location:
- trunk/lib
- Files:
-
- 2 modified
-
camping-unabridged.rb (modified) (1 diff)
-
camping.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/camping-unabridged.rb
r188 r189 411 411 fh="" 412 412 end 413 while l=@in.read(16384) 414 if l=~b 413 s=8192 414 k='' 415 l=@in.read(s*2) 416 while l 417 if (k<<l)=~b 415 418 o<<$`.chomp 416 419 @in.seek(-$'.size,IO::SEEK_CUR) 417 420 break 418 421 end 419 o<<l 422 o<<k.slice!(0...s) 423 l=@in.read(s) 420 424 end 421 425 C.qsp(fn,'&;',fh,qs) if fn -
trunk/lib/camping.rb
r188 r189 19 19 when/^Content-D.+?: form-data;/;fh.u H[*$'.scan(/(?:\s(\w+)="([^"]+)")/).flatten] 20 20 when/^Content-Type: (.+?)(\r$|\Z)/m;fh[:type]=$1;end;end;fn=fh[:name];o=if 21 fh[:filename];o=fh[:tempfile]=Tempfile.new(:C);o.binmode;else;fh=""end;while l=@in. 22 read(16384);if l=~b;o<<$`.chomp;@in.seek(-$'.size,IO::SEEK_CUR);break;end;o<<l 21 fh[:filename];o=fh[:tempfile]=Tempfile.new(:C);o.binmode;else;fh=""end;s=8192;k= 22 '';l=@in.read(s*2);while l;if(k<<l)=~b;o<<$`.chomp;@in.seek(-$'.size, 23 IO::SEEK_CUR);break;end;o<<k.slice!(0...s);l=@in.read(s) 23 24 end;C.qsp(fn,'&;',fh,q) if fn;fh[:tempfile].rewind if fh.is_a?H;end;elsif@method== 24 25 "post" and e.CONTENT_TYPE == "application/x-www-form-urlencoded"
