Module: Seahorse::Client::NetHttp::Patches::Ruby_1_9_3 Private

Defined in:
lib/seahorse/client/net_http/patches.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#new_transport_request(req) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/seahorse/client/net_http/patches.rb', line 83

def new_transport_request(req)
  begin_transport req
  res = catch(:response) {
    req.exec @socket, @curr_http_version, edit_path(req.path)
    begin
      res = Net::HTTPResponse.read_new(@socket)
    end while res.kind_of?(Net::HTTPContinue)
    res
  }
  res.reading_body(@socket, req.response_body_permitted?) {
    yield res if block_given?
  }
  end_transport req, res
  res
rescue => exception
  D "Conn close because of error #{exception}"
  @socket.close if @socket and not @socket.closed?
  raise exception
end