diff options
author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-06 17:08:21 +0000 |
---|---|---|
committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-06 17:08:21 +0000 |
commit | 3eedf9156cf01751423a99ef2939ec81964155d2 (patch) | |
tree | 9cc29f6a4e68821dcdaa57058bf44871bcd4fd8c /lib/net/pop.rb | |
parent | dd53813e38e2839b08cc540df6296c392dbf3c25 (diff) | |
download | ruby-3eedf9156cf01751423a99ef2939ec81964155d2.tar.gz |
* lib/net/http.rb: spin off https code again.
* lib/net/https.rb: new file.
* ext/openssl/lib/net/https.rb: removed. moved to net/https with modifications.
* ext/openssl/lib/net/protocol.rb: removed. merged with net/http.
* lib/net/protocol.rb: new class BufferedIO.
* lib/net/protocol.rb: InternetMessageIO < BufferedIO.
* lib/net/protocol.rb: BufferedIO.new takes an IO.
* lib/net/smtp.rb: follow InternetMessageIO's change.
* lib/net/pop.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net/pop.rb')
-rw-r--r-- | lib/net/pop.rb | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/lib/net/pop.rb b/lib/net/pop.rb index 5ada68fd4d..278b949395 100644 --- a/lib/net/pop.rb +++ b/lib/net/pop.rb @@ -1,17 +1,17 @@ # = net/pop.rb # #-- -# Copyright (c) 1999-2003 Yukihiro Matsumoto -# Copyright (c) 1999-2003 Minero Aoki +# Copyright (c) 1999-2004 Yukihiro Matsumoto +# Copyright (c) 1999-2004 Minero Aoki # -# written & maintained by Minero Aoki <aamine@loveruby.net> +# written and maintained by Minero Aoki <aamine@loveruby.net> # # This program is free software. You can re-distribute and/or # modify this program under the same terms as Ruby itself, -# Ruby Distribute License or GNU General Public License. +# Ruby Distribute License. # -# NOTE: You can find Japanese version of this document in -# the doc/net directory of the standard ruby interpreter package. +# NOTE: You can find Japanese version of this document at: +# http://www.ruby-lang.org/ja/man/index.cgi?cmd=view;name=net%2Fpop.rb # # $Id$ #++ @@ -168,6 +168,7 @@ require 'net/protocol' require 'digest/md5' +require 'timeout' module Net @@ -424,8 +425,12 @@ module Net end def do_start( account, password ) - @socket = self.class.socket_type.open(@address, @port, - @open_timeout, @read_timeout, @debug_output) + @socket = InternetMessageIO.new(timeout(@open_timeout) { + TCPSocket.open(@address, @port) + }) + logging "POP session started: #{@address}:#{@port} (#{@apop ? 'APOP' : 'POP'})" + @socket.read_timeout = @read_timeout + @socket.debug_output = @debug_output on_connect @command = POP3Command.new(@socket) if apop? @@ -558,6 +563,10 @@ module Net end end + def logging(msg) + @debug_output << msg if @debug_output + end + end # class POP3 # class aliases |