Class: Net::HTTPGenericRequest::Chunker
- Inherits:
-
Object
- Object
- Net::HTTPGenericRequest::Chunker
- Defined in:
- lib/net/http/generic_request.rb
Overview
:stopdoc:
Instance Method Summary collapse
- #finish ⇒ Object
-
#initialize(sock) ⇒ Chunker
constructor
:nodoc:.
- #write(buf) ⇒ Object
Constructor Details
#initialize(sock) ⇒ Chunker
:nodoc:
267 268 269 270 |
# File 'lib/net/http/generic_request.rb', line 267 def initialize(sock) @sock = sock @prev = nil end |
Instance Method Details
#finish ⇒ Object
279 280 281 |
# File 'lib/net/http/generic_request.rb', line 279 def finish @sock.write("0\r\n\r\n") end |
#write(buf) ⇒ Object
272 273 274 275 276 277 |
# File 'lib/net/http/generic_request.rb', line 272 def write(buf) # avoid memcpy() of buf, buf can huge and eat memory bandwidth rv = buf.bytesize @sock.write("#{rv.to_s(16)}\r\n", buf, "\r\n") rv end |