net-ssh 2.0.13 → 2.0.14

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.
@@ -1,5 +1,12 @@
1
1
 
2
2
 
3
+ === 2.0.14 / 28 Aug 2009
4
+
5
+ * Fix for IO#select threading bug in Ruby 1.8 (LH-1) [Daniel Azuma]
6
+
7
+ * Fix for "uninitialized constant OpenSSL::Digest::MD5" exception in Net::SFTP [DL Redden]
8
+
9
+
3
10
  === 2.0.13 / 17 Aug 2009
4
11
 
5
12
  * Added fix for hanging in ServerVersion#negotiate! when using SOCKS5 proxy (GH-9) [Gerald Talton]
@@ -1,5 +1,6 @@
1
1
  require 'net/ssh/buffer'
2
2
  require 'net/ssh/loggable'
3
+ require 'net/ssh/ruby_compat'
3
4
 
4
5
  module Net; module SSH
5
6
 
@@ -109,7 +110,7 @@ module Net; module SSH
109
110
  def wait_for_pending_sends
110
111
  send_pending
111
112
  while output.length > 0
112
- result = IO.select(nil, [self]) or next
113
+ result = Net::SSH::Compat.io_select(nil, [self]) or next
113
114
  next unless result[1].any?
114
115
  send_pending
115
116
  end
@@ -146,4 +147,4 @@ module Net; module SSH
146
147
  end
147
148
  end
148
149
 
149
- end; end
150
+ end; end
@@ -1,4 +1,5 @@
1
1
  require 'net/ssh/loggable'
2
+ require 'net/ssh/ruby_compat'
2
3
  require 'net/ssh/connection/channel'
3
4
  require 'net/ssh/connection/constants'
4
5
  require 'net/ssh/service/forward'
@@ -197,7 +198,7 @@ module Net; module SSH; module Connection
197
198
 
198
199
  r = listeners.keys
199
200
  w = r.select { |w2| w2.respond_to?(:pending_write?) && w2.pending_write? }
200
- readers, writers, = IO.select(r, w, nil, wait)
201
+ readers, writers, = Net::SSH::Compat.io_select(r, w, nil, wait)
201
202
 
202
203
  postprocess(readers, writers)
203
204
  end
@@ -1,7 +1,35 @@
1
+ require 'thread'
2
+
1
3
  class String
2
4
  if RUBY_VERSION < "1.9"
3
5
  def getbyte(index)
4
6
  self[index]
5
7
  end
6
8
  end
7
- end
9
+ end
10
+
11
+ module Net; module SSH
12
+
13
+ # This class contains miscellaneous patches and workarounds
14
+ # for different ruby implementations.
15
+ class Compat
16
+
17
+ # A workaround for an IO#select threading bug in MRI 1.8.
18
+ # See: http://net-ssh.lighthouseapp.com/projects/36253/tickets/1-ioselect-threading-bug-in-ruby-18
19
+ # Also: http://redmine.ruby-lang.org/issues/show/1993
20
+ if RUBY_VERSION >= '1.9' || RUBY_PLATFORM == 'java'
21
+ def self.io_select(*params)
22
+ IO.select(*params)
23
+ end
24
+ else
25
+ SELECT_MUTEX = Mutex.new
26
+ def self.io_select(*params)
27
+ SELECT_MUTEX.synchronize do
28
+ IO.select(*params)
29
+ end
30
+ end
31
+ end
32
+
33
+ end
34
+
35
+ end; end
@@ -1,4 +1,5 @@
1
1
  require 'openssl'
2
+ require 'openssl/digest'
2
3
 
3
4
  module Net; module SSH; module Transport; module HMAC
4
5
 
@@ -1,10 +1,12 @@
1
1
  require 'net/ssh/buffered_io'
2
2
  require 'net/ssh/errors'
3
3
  require 'net/ssh/packet'
4
+ require 'net/ssh/ruby_compat'
4
5
  require 'net/ssh/transport/cipher_factory'
5
6
  require 'net/ssh/transport/hmac'
6
7
  require 'net/ssh/transport/state'
7
8
 
9
+
8
10
  module Net; module SSH; module Transport
9
11
 
10
12
  # A module that builds additional functionality onto the Net::SSH::BufferedIo
@@ -62,13 +64,13 @@ module Net; module SSH; module Transport
62
64
  Socket.getnameinfo(addr, Socket::NI_NUMERICHOST | Socket::NI_NUMERICSERV).first
63
65
  end
64
66
  end
65
-
67
+
66
68
  # Returns true if the IO is available for reading, and false otherwise.
67
69
  def available_for_read?
68
- result = IO.select([self], nil, nil, 0)
70
+ result = Net::SSH::Compat.io_select([self], nil, nil, 0)
69
71
  result && result.first.any?
70
72
  end
71
-
73
+
72
74
  # Returns the next full packet. If the mode parameter is :nonblock (the
73
75
  # default), then this will return immediately, whether a packet is
74
76
  # available or not, and will return nil if there is no packet ready to be
@@ -86,7 +88,7 @@ module Net; module SSH; module Transport
86
88
  return packet if packet
87
89
 
88
90
  loop do
89
- result = IO.select([self]) or next
91
+ result = Net::SSH::Compat.io_select([self]) or next
90
92
  break if result.first.any?
91
93
  end
92
94
 
@@ -227,4 +229,4 @@ module Net; module SSH; module Transport
227
229
  end
228
230
  end
229
231
 
230
- end; end; end
232
+ end; end; end
@@ -51,7 +51,7 @@ module Net; module SSH
51
51
  MINOR = 0
52
52
 
53
53
  # The tiny component of this version of the Net::SSH library
54
- TINY = 13
54
+ TINY = 14
55
55
 
56
56
  # The current version of the Net::SSH library as a Version instance
57
57
  CURRENT = new(MAJOR, MINOR, TINY)
@@ -1,7 +1,7 @@
1
1
  @spec = Gem::Specification.new do |s|
2
2
  s.name = "net-ssh"
3
3
  s.rubyforge_project = 'net-ssh'
4
- s.version = "2.0.13"
4
+ s.version = "2.0.14"
5
5
  s.summary = "Net::SSH: a pure-Ruby implementation of the SSH2 client protocol."
6
6
  s.description = s.summary
7
7
  s.authors = ["Jamis Buck", "Delano Mandelbaum"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-ssh
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.13
4
+ version: 2.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamis Buck
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-08-17 00:00:00 -04:00
13
+ date: 2009-08-28 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies: []
16
16