summaryrefslogtreecommitdiff
path: root/lib/net
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net')
-rw-r--r--lib/net/http.rb1
-rw-r--r--lib/net/pop.rb13
2 files changed, 11 insertions, 3 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb
index 8410497437..2b18a8e930 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -425,6 +425,7 @@ module Net
req['connection'] = 'close'
elsif @socket.closed? then
@socket.reopen
+ on_connect
end
if @seems_1_0_server then
req['connection'] = 'close'
diff --git a/lib/net/pop.rb b/lib/net/pop.rb
index 00fff60824..dbb55466e7 100644
--- a/lib/net/pop.rb
+++ b/lib/net/pop.rb
@@ -21,7 +21,7 @@ Net::Protocol
=== Class Methods
-: new( address = 'localhost', port = 110 )
+: new( address = 'localhost', port = 110, apop = false )
creates a new Net::POP3 object.
This method does not open TCP connection yet.
@@ -184,6 +184,7 @@ module Net
protocol_param :port, '110'
protocol_param :command_type, '::Net::NetPrivate::POP3Command'
+ protocol_param :apop_command_type, '::Net::NetPrivate::APOPCommand'
protocol_param :mail_type, '::Net::POPMail'
@@ -206,9 +207,10 @@ module Net
end
- def initialize( addr = nil, port = nil )
- super
+ def initialize( addr = nil, port = nil, apop = false )
+ super addr, port
@mails = nil
+ @apop = false
end
attr :mails
@@ -238,6 +240,11 @@ module Net
private
+ def conn_command( sock )
+ @command =
+ (@apop ? type.apop_command_type : type.command_type).new(sock)
+ end
+
def do_start( acnt, pwd )
@command.auth( acnt, pwd )