Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion ext/openssl/ossl_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2440,7 +2440,14 @@ ossl_ssl_get_state(VALUE self)
* call-seq:
* ssl.pending => Integer
*
* The number of bytes that are immediately available for reading.
* Returns the number of bytes buffered by the OpenSSL library and immediately
* available for reading with #sysread.
*
* This does not include data read ahead and buffered by SSLSocket. It may
* therefore return 0 even when data is available for reading with methods
* that are aware of the SSLSocket buffer, such as #read or #gets.
*
* See also the man page SSL_pending(3).
*/
static VALUE
ossl_ssl_pending(VALUE self)
Expand Down
9 changes: 9 additions & 0 deletions lib/openssl/ssl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,23 @@ def close_on_exec?
to_io.close_on_exec?
end

# Calls IO#wait on the underlying socket.
#
# Note that this method may block even when there is data immediately
# available to read, unlike IO#wait_readable.
def wait(*args)
to_io.wait(*args)
end

# Calls IO#wait_readable on the underlying socket.
#
# Note that this method may block even when there is data immediately
# available to read, unlike IO#wait_readable.
def wait_readable(*args)
to_io.wait_readable(*args)
end

# Calls IO#wait_writable on the underlying socket.
def wait_writable(*args)
to_io.wait_writable(*args)
end
Expand Down
Loading