http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
req = Net::HTTP::Post.new(url.path)
req.basic_auth "admin","admin"
req.content_length = post_stream.size
req.content_type = 'multipart/form-data; boundary=' + boundary
req.body_stream = post_stream
res = Net::HTTP.new(url.host, url.port).start{|http| http.request(req)}
streams.each do |stream|
stream.close();
end
res
end
end
class StreamPart
def initialize(stream, size)
@stream, @size = stream, size
end
def size
@size
end
def read(offset, how_much)
@stream.read(how_much)
end
end
class StringPart
def initialize(str)
@str = str
end
def size
@str.length
end
def read(offset, how_much)
@str[offset, how_much]
end
end
An established connection was aborted by the software in your host machine.
C:/Ruby/lib/ruby/1.8/net/protocol.rb:175:in `write'
C:/Ruby/lib/ruby/1.8/net/protocol.rb:175:in `write0'
C:/Ruby/lib/ruby/1.8/net/protocol.rb:151:in `write'
C:/Ruby/lib/ruby/1.8/net/protocol.rb:166:in `writing'
C:/Ruby/lib/ruby/1.8/net/protocol.rb:150:in `write'
C:/Ruby/lib/ruby/1.8/net/http.rb:1557:in `send_request_with_body_stream'
C:/Ruby/lib/ruby/1.8/net/http.rb:1527:in `exec'
C:/Ruby/lib/ruby/1.8/net/http.rb:1048:in `request'
C:/WORKSPACE/get_rac.rb:48:in `post'
C:/Ruby/lib/ruby/1.8/net/http.rb:543:in `start'
C:/WORKSPACE/get_rac.rb:48:in `post'
C:/WORKSPACE/get_rac.rb:137:in `get_rac'
C:/WORKSPACE/get_rac.rb:167
C:/Ruby/lib/ruby/1.8/net/protocol.rb:175:in `write': An established connection was aborted by the software in your host machine. (Errno::ECONNABORTED)
from C:/Ruby/lib/ruby/1.8/net/protocol.rb:175:in `write0'
from C:/Ruby/lib/ruby/1.8/net/protocol.rb:151:in `write'
from C:/Ruby/lib/ruby/1.8/net/protocol.rb:166:in `writing'
from C:/Ruby/lib/ruby/1.8/net/protocol.rb:150:in `write'
from C:/Ruby/lib/ruby/1.8/net/http.rb:1557:in `send_request_with_body_stream'
from C:/Ruby/lib/ruby/1.8/net/http.rb:1527:in `exec'
from C:/Ruby/lib/ruby/1.8/net/http.rb:1048:in `request'
from C:/WORKSPACE/get_rac.rb:48:in `post'
from C:/Ruby/lib/ruby/1.8/net/http.rb:543:in `start'
from C:/WORKSPACE/get_rac.rb:48:in `post'
from C:/WORKSPACE/get_rac.rb:137:in `get_rac'
from C:/WORKSPACE/get_rac.rb:167