diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net/ftp.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb index 9f2f76fb1d..e2bf1b29fc 100644 --- a/lib/net/ftp.rb +++ b/lib/net/ftp.rb @@ -1443,16 +1443,32 @@ module Net if defined?(OpenSSL::SSL::SSLSocket) class BufferedSSLSocket < BufferedSocket + def initialize(*args) + super + @is_shutdown = false + end + def shutdown(*args) # SSL_shutdown() will be called from SSLSocket#close, and # SSL_shutdonw() will send the "close notify" alert to the peer, # so shutdown(2) should not be called. + @is_shutdown = true end def send(mesg, flags, dest = nil) # Ignore flags and dest. @io.write(mesg) end + + private + + def rbuf_fill + if @is_shutdown + raise EOFError, "shutdown has been called" + else + super + end + end end end # :startdoc: |