about summary refs log tree commit homepage
path: root/GIT-VERSION-GEN
diff options
context:
space:
mode:
authorAndrey Stikheev <andrey.stikheev@gmail.com>2009-10-25 13:11:35 +0300
committerEric Wong <normalperson@yhbt.net>2009-10-25 14:06:14 -0700
commitbbca687b8ce0c0cbf10407f2aaf87e18bfc311e5 (patch)
treed5af9c04bda396328d3dd47e65cdc69f227d3703 /GIT-VERSION-GEN
parent3a624fe924b8f3a9dfdcf5222ed6d1968f462468 (diff)
downloadunicorn-bbca687b8ce0c0cbf10407f2aaf87e18bfc311e5.tar.gz
Under FreeBSD writing to the file in sync mode does not change current
position, so change position to the end of the file. Without this patch
multipart post requests with large data (image uploading) does not work
correctly:

  Status: 500 Internal Server Error
  bad content body
    /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/utils.rb:347:in `parse_multipart'
    /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/utils.rb:319:in `loop'
    /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/utils.rb:319:in `parse_multipart'

File position behavior under FreeBSD  :

ruby -v
ruby 1.8.7 (2009-04-08 patchlevel 160) [i386-freebsd7]

irb(main):001:0> b  = File.new("abc", "w+")
=> #<File:abc>
irb(main):002:0>  b.sync = true
=> true
irb(main):004:0> b.write("abc")
=> 3
irb(main):005:0> b.pos
=> 0

Acked-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 'GIT-VERSION-GEN')
0 files changed, 0 insertions, 0 deletions