netsoul 0.5.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3c63a4a266613cfd391300dc3b956822ee76fd66
4
- data.tar.gz: 3186372ef1119950c82d7484f70e81819a097060
3
+ metadata.gz: fc986dc3e21a355d48e3e08494dc8f8e20f8e10b
4
+ data.tar.gz: 11cfd33d73a5aa6ce747a6d6366d527d5dd390cc
5
5
  SHA512:
6
- metadata.gz: 4811496fc6e71bc5557485592e9ee4fa198b142a148f9498cf92419904f4fd60641c6fa7b94607b8f251cdcbee390f113d2002fe2d34eb3185623e8a20c5a84b
7
- data.tar.gz: 1700b440b9c802256d3949ff56473bfc7044c0e5ccbac251da46d7d24faa7494eaf647b05a55d4ca1277adf44971e8b8088db1ce3f658eaef23c4d7c4edd9930
6
+ metadata.gz: 538ccf6b1c16631a498b33c9f9b8b1dc97f16e04808d522a1b9b8872d8bf3dde24648d3bbcd4f23b3c2c76f58762860adc859130f7a99abfaf37d35d622ff956
7
+ data.tar.gz: f6f9e1d42043ec7c64215a0827f65e2b5d3ccdc76d97306b50bf1ad4b4f2293527e04d00dbda16c78c539ee01a9f6fce99ff195422f85ecc8f3627a0b087cf89
data/bin/netsoul-ruby CHANGED
@@ -112,12 +112,30 @@ unless options.include?(:config)
112
112
  exit
113
113
  end
114
114
 
115
- c = Netsoul::Client.new options[:user_opts]
116
- c.connect
117
- if c.started
118
- loop do
119
- res = c.sock_get
120
- c.sock_send res if res.to_s.match(/^ping.*/)
121
- sleep 1
115
+ retry_count = 10
116
+ retry_wait_time = 1.0
117
+ RETRY_WAIT_FACTOR = 1.25 # Each time retry is called 'retry_wait_time' is increased with this factor
118
+ begin
119
+ c = Netsoul::Client.new options[:user_opts]
120
+ c.connect
121
+ if c.started
122
+ retry_count = 10
123
+ retry_wait_time = 1.0
124
+ loop do
125
+ res = c.sock_get
126
+ c.sock_send res if res.to_s.match(/^ping.*/)
127
+ sleep 1
128
+ end
129
+ end
130
+ rescue => e
131
+ puts "[ERROR]: #{e}"
132
+ puts "[RETRY_COUNT]: #{retry_count}"
133
+ c.disconnect
134
+ c = nil
135
+ if retry_count > 0
136
+ retry_count -= 1
137
+ retry_wait_time *= RETRY_WAIT_FACTOR
138
+ sleep retry_count
139
+ retry
122
140
  end
123
141
  end
@@ -21,6 +21,7 @@ module Netsoul
21
21
  "ext_user_log #{config.login} #{_standard_auth_string(config)} #{client_name} #{location}"
22
22
  end
23
23
 
24
+ # :nocov:
24
25
  def _kerberos_get
25
26
  @netsoul_kerberos ||= NetsoulKerberos.new
26
27
  rescue LoadError => e
@@ -42,6 +43,7 @@ module Netsoul
42
43
  end
43
44
  _kerberos_auth_klog(config)
44
45
  end
46
+ # :nocov:
45
47
 
46
48
  def auth_ag
47
49
  'auth_ag ext_user none none'.freeze
@@ -84,35 +86,19 @@ module Netsoul
84
86
  end
85
87
 
86
88
  def xfer(user, id, filename, size, desc)
87
- "user_cmd msg_user #{user} desoul_ns_xfer #{Message._escape("#{id} #{filename} #{size} #{desc}")}"
88
- end
89
-
90
- def desoul_ns_xfer(user, id, filename, size, desc)
91
- xfer(user, id, filename, size, desc)
89
+ "user_cmd msg_user #{user} xfer #{Message._escape("#{id} #{filename} #{size} #{desc}")}"
92
90
  end
93
91
 
94
92
  def xfer_accept(user, id)
95
- "user_cmd msg_user #{user} desoul_ns_xfer_accept #{id}"
96
- end
97
-
98
- def desoul_ns_xfer_accept(user, id)
99
- xfer_accept(user, id)
93
+ "user_cmd msg_user #{user} xfer_accept #{id}"
100
94
  end
101
95
 
102
96
  def xfer_data(user, id, data)
103
- "user_cmd msg_user #{user} desoul_ns_xfer_data #{Message._escape("#{id} #{Base64.b64encode(data.to_s, data.to_s.length)}")}"
104
- end
105
-
106
- def desoul_ns_xfer_data(user, id, data)
107
- xfer_data(user, id, data)
97
+ "user_cmd msg_user #{user} xfer_data #{Message._escape("#{id} #{Base64.encode64(data.to_s)}")}"
108
98
  end
109
99
 
110
100
  def xfer_cancel(user, id)
111
- "user_cmd msg_user #{user} desoul_ns_xfer_cancel #{id}"
112
- end
113
-
114
- def desoul_ns_xfer_cancel(user, id)
115
- xfer_cancel(user, id)
101
+ "user_cmd msg_user #{user} xfer_cancel #{id}"
116
102
  end
117
103
 
118
104
  def ping
@@ -1,3 +1,3 @@
1
1
  module Netsoul
2
- VERSION = '0.5.0'.freeze
2
+ VERSION = '1.1.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: netsoul
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Kakesa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-05 00:00:00.000000000 Z
11
+ date: 2016-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler