Use syswrite_full when PUT-ing smaller files
commit8f33fa98734a3b2d44c81e63ff77851887d736d3
authorEric Wong <normalperson@yhbt.net>
Tue, 6 Jan 2009 10:05:56 +0000 (6 02:05 -0800)
committerEric Wong <normalperson@yhbt.net>
Tue, 6 Jan 2009 10:08:50 +0000 (6 02:08 -0800)
treebbf8d45346e1ab04fd3b6a866ceb93d37f953336
parent27092c172aaf828740f85d45a410a18c346db8f8
Use syswrite_full when PUT-ing smaller files

Socket#send will return with short writes and IO.write just
sucks, so expose our existing syswrite_full routine to the
public.

While we're at it, add a unit test to try to ensure that we're
correctly doing syswrite_full here.  System-specific behavior
dealing with buffer sizes is not easy to test...
lib/mogilefs/httpfile.rb
lib/mogilefs/util.rb
test/test_util.rb [new file with mode: 0644]