smart_proxy_remote_execution_ssh 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e58a285a16b7d9a173ee4c29639b3367517c5d84f7979bdc84ab2c502a51edb1
4
- data.tar.gz: 57892ef63dc0a6bd156ae6fef562b8a4096a7a3cd6a2a03828b4598b1b1d37c7
3
+ metadata.gz: 65bdd1bbf94900594e4a6acf2d3c1522e778dc7ca5eff5c70b085a5cf9b077c9
4
+ data.tar.gz: 7c1321bd2b69b5e4498df66b000814cffaffcc770220e09648c98534e60ce900
5
5
  SHA512:
6
- metadata.gz: 89cc41ef35aa11210f322afc3b7ae35aa269cc4ed8fcef8faff11e32ac37fe765cc083d0bdef2b9c58a54f96be5c8224c5916b85cbb393040f6e715816bf51b7
7
- data.tar.gz: ec608d3b666443e6afbb97d28f1014f459d746d65adcf0e1f0cd43d168961e05884f8d3e393814f594527a294d6ac56d2af432509b8ecb99cfcf0df7101f501b
6
+ metadata.gz: 439a6ac3a27140f930a52806e6708d1961343de024b0b5398be70add77be7a0a095a609c03c282371e9c0f8f6dead04b906b9fcb64618463594e69e5ab2c0290
7
+ data.tar.gz: 54cfbbbc9001fef48bf7ea607ad68b507fcd5610213ec81e9176d705364b0c5f207fbaed441102a645d25f86ff3d2a653fdce69a019daf83f84e45fa6e098315
@@ -180,10 +180,11 @@ module Proxy::RemoteExecution
180
180
 
181
181
  def inner_system_ssh_loop(out_buf, err_buf, in_buf, pid)
182
182
  err_buf_raw = ''
183
- readers = [buf_socket, out_buf, err_buf]
184
183
  loop do
184
+ readers = [buf_socket, out_buf, err_buf].reject { |io| io.closed? }
185
+ writers = [buf_socket, in_buf].select { |io| io.pending_writes? }
185
186
  # Prime the sockets for reading
186
- ready_readers, ready_writers = IO.select(readers, [buf_socket, in_buf], nil, 300)
187
+ ready_readers, ready_writers = IO.select(readers, writers)
187
188
  (ready_readers || []).each { |reader| reader.close if reader.fill.zero? }
188
189
 
189
190
  proxy_data(out_buf, in_buf)
@@ -173,10 +173,14 @@ module Proxy::RemoteExecution
173
173
  output.append(data)
174
174
  end
175
175
 
176
+ def pending_writes?
177
+ output.length.positive?
178
+ end
179
+
176
180
  # Sends as much of the pending output as possible. Returns +true+ if any
177
181
  # data was sent, and +false+ otherwise.
178
182
  def send_pending
179
- if output.length.positive?
183
+ if pending_writes?
180
184
  sent = send(output.to_s, 0)
181
185
  output.consume!(sent)
182
186
  return sent.positive?
@@ -189,7 +193,7 @@ module Proxy::RemoteExecution
189
193
  # buffer is empty.
190
194
  def wait_for_pending_sends
191
195
  send_pending
192
- while output.length.positive?
196
+ while pending_writes?
193
197
  result = IO.select(nil, [self]) || next
194
198
  next unless result[1].any?
195
199
 
@@ -279,6 +279,7 @@ module Proxy::RemoteExecution::Ssh::Runners
279
279
  ssh_options << "-o ControlMaster=auto"
280
280
  ssh_options << "-o ControlPath=#{socket_file}"
281
281
  ssh_options << "-o ControlPersist=yes"
282
+ ssh_options << "-o ProxyCommand=none"
282
283
  end
283
284
 
284
285
  def settings
@@ -1,7 +1,7 @@
1
1
  module Proxy
2
2
  module RemoteExecution
3
3
  module Ssh
4
- VERSION = '0.7.0'
4
+ VERSION = '0.7.1'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_proxy_remote_execution_ssh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Nečas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-13 00:00:00.000000000 Z
11
+ date: 1980-01-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -203,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
203
203
  - !ruby/object:Gem::Version
204
204
  version: '0'
205
205
  requirements: []
206
- rubygems_version: 3.1.4
206
+ rubygems_version: 3.2.26
207
207
  signing_key:
208
208
  specification_version: 4
209
209
  summary: Ssh remote execution provider for Foreman Smart-Proxy