diff options
author | Eric Wong <e@80x24.org> | 2016-12-29 07:31:40 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-12-29 07:31:40 +0000 |
commit | 8307157e7381f24b2833d3e3fdf084555265f420 (patch) | |
tree | 504aade3405a391d222b77571b145e8322dc2829 /lib/mogilefs/new_file/stream.rb | |
parent | 6f35eb68c0b45aa64da442022cda82b7df9194c4 (diff) | |
download | mogilefs-client-8307157e7381f24b2833d3e3fdf084555265f420.tar.gz |
None of these are too performance critical, but err on the safe side and avoid allocations whenever possible.
Diffstat (limited to 'lib/mogilefs/new_file/stream.rb')
-rw-r--r-- | lib/mogilefs/new_file/stream.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/mogilefs/new_file/stream.rb b/lib/mogilefs/new_file/stream.rb index 71ac591..195b121 100644 --- a/lib/mogilefs/new_file/stream.rb +++ b/lib/mogilefs/new_file/stream.rb @@ -66,7 +66,7 @@ class MogileFS::NewFile::Stream def start_sock(sock, uri) host_with_port = "#{uri.host}:#{uri.port}" headers = "PUT #{uri.request_uri} HTTP/1.1\r\n" \ - "Host: #{host_with_port}\r\n" \ + "Host: #{host_with_port}\r\n" content_md5 = @opts[:content_md5] if String === content_md5 @@ -75,16 +75,16 @@ class MogileFS::NewFile::Stream :trailer == content_md5 || MD5_TRAILER_NODES[host_with_port] @md5 = Digest::MD5.new - headers << "Trailer: Content-MD5\r\n" + headers << "Trailer: Content-MD5\r\n".freeze end if ! @md5 && clen = @opts[:content_length] headers << "Content-Length: #{clen}\r\n" else - headers << "Transfer-Encoding: chunked\r\n" + headers << "Transfer-Encoding: chunked\r\n".freeze end - sock.write(headers << "\r\n") + sock.write(headers << "\r\n".freeze) end alias syswrite write |