Ticket #130 (closed defect: fixed)
[PATCH] Apache/CGI upload ESPIPE error
| Reported by: | jsheets | Owned by: | somebody |
|---|---|---|---|
| Priority: | major | Milestone: | Camping 1.6 |
| Component: | camping.rb | Version: | 1.5 |
| Keywords: | apache upload cgi | Cc: |
Description
File uploads using Apache CGI fail with an ESPIPE error when calling seek() on the pipe. The stack against camping-unabridged.rb (r194):
(eval):419:in 'seek': Illegal seek (Errno::ESPIPE)
from (eval):419:in 'initialize'
from (eval):685:in 'run'
The workaround is to buffer the pipe with a StringIO.
@in = r
if %r|\Amultipart/form-data.*boundary=\"?([^\";,]+)|n.match(e.CONTENT_TYPE)
+ @in = StringIO.new(r.read) if @in.stat.pipe?
Also, there appears to be a spurious debug statement that causes a malformed header error during uploads (deleted by the patch):
puts "=> fh[type] = #$1"
Change History
Note: See
TracTickets for help on using
tickets.
