lib/fastdfs-client/tracker.rb in fastdfs-client-1.0.0 vs lib/fastdfs-client/tracker.rb in fastdfs-client-1.0.1

- old
+ new

@@ -6,21 +6,22 @@ class Tracker attr_accessor :socket, :cmd, :options def initialize(host, port, options = {}) - @socket = Socket.new(host, port, options[:socket]) + @options = options + @socket = Socket.new(host, port, @options[:socket]) @cmd = CMD::STORE_WITHOUT_GROUP_ONE end def get_storage client = ClientProxy.new(@cmd, @socket, 0) res = client.dispose do |body| storage_ip = body[ProtoCommon::IPADDR].strip storage_port = body[ProtoCommon::PORT].unpack("C*").to_pack_long store_path = body[ProtoCommon::TRACKER_BODY_LEN-1].unpack("C*")[0] - Storage.new(storage_ip, storage_port, store_path, options) + Storage.new(storage_ip, storage_port, store_path, @options) end res[:status] ? res[:result] : res end end \ No newline at end of file