fiverr_copy 0.0.16 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -55,10 +55,9 @@ class FiverrCopy::Client
55
55
  puts "Last hop mode"
56
56
  end
57
57
 
58
- temp_file = Tempfile.new("fiverr_copy_#{Time.now.to_i}.tgz")
59
58
  File.open(filename, "w+") do |f|
60
- Thread.start do
61
- while (stream = session.read(chunk)) do
59
+ # Thread.start do
60
+ while (stream = session.read(chunk.to_i)) do
62
61
 
63
62
  puts "Connection from #{session.peeraddr[2]} at #{session.peeraddr[3]}"
64
63
 
@@ -69,7 +68,7 @@ class FiverrCopy::Client
69
68
  client_session.write(stream) if !(next_client.nil?)
70
69
  session.puts "OK:#{stream.size}"
71
70
  end
72
- end #end thread conversation
71
+ # end #end thread conversation
73
72
  end
74
73
  puts "Done."
75
74
  end
@@ -19,20 +19,19 @@ class FiverrCopy::Server
19
19
  if !(self.recipe.manual_client_activation?)
20
20
  self.recipe.initialized_clients.each do |client|
21
21
  threads << Thread.new(client) do |current_client|
22
- current_client.setup!
22
+ #current_client.setup!
23
23
  puts "Connecting to #{current_client.client_ip}:#{self.recipe.port}"
24
24
  Net::SSH.start(current_client.client_ip, current_client.username) do |ssh|
25
- ssh.exec("killall fiverr_copy")
25
+ #ssh.exec("killall fiverr_copy")
26
26
  next_client = "--nexthop #{current_client.next_client}" if current_client.next_client
27
27
  puts "#{current_client}: fiverr_copy --client --port #{self.recipe.port} --filename #{compressed_file_name} --chunk #{self.recipe.chunk_size} #{next_client} \&"
28
- ssh.exec("fiverr_copy --client --port #{self.recipe.port} --filename #{compressed_file_name} --chunk #{self.recipe.chunk_size} #{next_client}")
28
+ ssh.exec("fiverr_copy --client --port #{self.recipe.port} --filename #{compressed_file_name} --chunk #{self.recipe.chunk_size} #{next_client} \&")
29
29
  end
30
30
  end
31
- sleep 10
32
31
  end
33
32
  end
34
33
 
35
-
34
+ puts "Booting clients"
36
35
 
37
36
  attempts = 1
38
37
  begin
@@ -63,11 +62,10 @@ class FiverrCopy::Server
63
62
  puts "Transmitting..."
64
63
 
65
64
  File.open("#{compressed_file_name}") do |transmitted_file|
66
- client_session.puts "FILENAME:#{"#{compressed_file_name}"}"
67
65
  puts "Transmitting #{transmitted_file.to_s} (#{File.size(transmitted_file)})"
68
66
  while !(client_session.closed?) && (buffer = transmitted_file.read(self.recipe.chunk_size)) do
69
67
  puts "Sending #{buffer.size}B"
70
- client_session.puts buffer
68
+ client_session.write buffer
71
69
  end
72
70
  puts "Done!"
73
71
  end
@@ -1,3 +1,3 @@
1
1
  module FiverrCopy
2
- VERSION = "0.0.16"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fiverr_copy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 63
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
+ - 1
7
8
  - 0
8
9
  - 0
9
- - 16
10
- version: 0.0.16
10
+ version: 1.0.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Elad Meidar