MogileFS::HTTPFile: support TCP_CORK on Linux
commit16cfeeb035c0c0362e8f4fb1707f9006573defc1
authorEric Wong <normalperson@yhbt.net>
Tue, 23 Dec 2008 03:00:13 +0000 (22 19:00 -0800)
committerEric Wong <normalperson@yhbt.net>
Tue, 23 Dec 2008 04:03:43 +0000 (22 20:03 -0800)
treefdbab7f9041e83caa2b4cf72814c35f294b376b3
parent46b2c5ff196c9194abae8954c9efdc899b1f1ff8
MogileFS::HTTPFile: support TCP_CORK on Linux

Since we use TCP_NODELAY with all sockets, the bigfile code path
here is less efficient because it sends the headers separately.
So use TCP_CORK for this part of the code to avoid sending
partial frames.

Additionally rewrite this to use send(2) which is more suitable
for sockets.

Since we didn't have any previously, add a test for uploading
large files.
lib/mogilefs/httpfile.rb
lib/mogilefs/util.rb
test/test_mogilefs.rb