Skip to content

Commit 6b226ca

Browse files
committed
📚 Document that open_timeout is used for TLS too
1 parent 72e4eb7 commit 6b226ca

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

lib/net/imap.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ class << self
843843

844844
##
845845
# :attr_reader: open_timeout
846-
# Seconds to wait until a connection is opened.
846+
# Seconds to wait until a connection is opened. Also used by #starttls.
847847
# Delegates to {config.open_timeout}[rdoc-ref:Config#open_timeout].
848848

849849
##
@@ -1341,6 +1341,10 @@ def logout!
13411341
# both successful. Any error indicates that the connection has not been
13421342
# secured.
13431343
#
1344+
# After the server agrees to start a TLS connection, this method waits up to
1345+
# {config.open_timeout}[rdoc-ref:Config#open_timeout] before raising
1346+
# +Net::OpenTimeout+.
1347+
#
13441348
# *Note:*
13451349
# >>>
13461350
# Any #response_handlers added before STARTTLS should be aware that the

lib/net/imap/config.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,13 @@ def self.[](config)
193193

194194
# Seconds to wait until a connection is opened.
195195
#
196+
# Applied separately for establishing TCP connection and starting a TLS
197+
# connection.
198+
#
196199
# If the IMAP object cannot open a connection within this time,
197200
# it raises a Net::OpenTimeout exception.
198201
#
199-
# See Net::IMAP.new.
202+
# See Net::IMAP.new and Net::IMAP#starttls.
200203
#
201204
# The default value is +30+ seconds.
202205
attr_accessor :open_timeout, type: Integer

0 commit comments

Comments
 (0)