0001-Bug-3341-Fix-broken-pipe-in-the-CLI-for-updates.patch

Jaime Melis, 11/18/2014 05:49 PM

Download (1.98 KB)

View differences:

src/oca/ruby/opennebula/client.rb
155 155
            @server = XMLRPC::Client.new2(@one_endpoint, http_proxy, timeout)
156 156
            @server.http_header_extra = {'accept-encoding' => 'identity'}
157 157

  
158
            http = @server.instance_variable_get("@http")
158
            @http = @server.instance_variable_get("@http")
159 159

  
160 160
            if options[:cert_dir] || ENV['ONE_CERT_DIR']
161 161
                raise "SSL options don't work in async mode" if @async
......
167 167
                cert_store.set_default_paths
168 168
                cert_files.each {|cert| cert_store.add_file(cert) }
169 169

  
170
                http.cert_store = cert_store
170
                @http.cert_store = cert_store
171 171
            end
172 172

  
173 173
            if options[:disable_ssl_verify] || ENV['ONE_DISABLE_SSL_VERIFY']
174 174
                raise "SSL options don't work in async mode" if @async
175 175

  
176
                http.verify_mode = OpenSSL::SSL::VERIFY_NONE
176
                @http.verify_mode = OpenSSL::SSL::VERIFY_NONE
177 177
            end
178 178

  
179 179
            if defined?(OxStreamParser)
......
186 186
        end
187 187

  
188 188
        def call(action, *args)
189
            # The XML-RPC connection times out, so we need to close it and open
190
            # it again.
191
            if @http.started? && !@async
192
                @http.finish
193
                @http.start
194
            end
195

  
189 196
            begin
190 197
                if @async
191 198
                    response = @server.call_async("one."+action, @one_auth, *args)
192
-