Class: Thrift::HTTPClientTransport

Inherits:
BaseTransport
  • Object
show all
Defined in:
lib/rbhive/t_c_l_i_connection.rb

Instance Method Summary collapse

Instance Method Details

#flushObject


18
19
20
21
22
23
24
25
26
27
28
# File 'lib/rbhive/t_c_l_i_connection.rb', line 18

def flush
  http = Net::HTTP.new @url.host, @url.port
  http.use_ssl = @url.scheme == 'https'
  http.read_timeout = nil
  http.verify_mode = @ssl_verify_mode if @url.scheme == 'https'
  resp = http.post(@url.request_uri, @outbuf, @headers)
  data = resp.body
  data = Bytes.force_binary_encoding(data)
  @inbuf = StringIO.new data
  @outbuf = Bytes.empty_byte_buffer
end