1999-10-13 11:29:15 +04:00
|
|
|
=begin
|
|
|
|
|
2001-12-13 22:15:21 +03:00
|
|
|
= net/protocol.rb
|
1999-10-13 11:29:15 +04:00
|
|
|
|
2001-06-27 03:49:21 +04:00
|
|
|
Copyright (c) 1999-2001 Yukihiro Matsumoto
|
1999-10-13 11:29:15 +04:00
|
|
|
|
2001-06-27 03:49:21 +04:00
|
|
|
written & maintained by Minero Aoki <aamine@loveruby.net>
|
1999-10-13 11:29:15 +04:00
|
|
|
|
2001-06-27 03:49:21 +04:00
|
|
|
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.
|
2001-02-24 07:53:50 +03:00
|
|
|
|
2001-12-07 13:04:25 +03:00
|
|
|
NOTE: You can find Japanese version of this document in
|
|
|
|
the doc/net directory of the standard ruby interpreter package.
|
1999-10-13 11:29:15 +04:00
|
|
|
|
2001-12-13 22:15:21 +03:00
|
|
|
$Id$
|
|
|
|
|
1999-10-13 11:29:15 +04:00
|
|
|
=end
|
|
|
|
|
2000-06-16 17:47:38 +04:00
|
|
|
require 'socket'
|
2001-02-06 14:14:51 +03:00
|
|
|
require 'timeout'
|
2000-06-16 17:47:38 +04:00
|
|
|
|
|
|
|
|
|
|
|
module Net
|
|
|
|
|
1999-12-29 14:14:04 +03:00
|
|
|
class Protocol
|
1999-12-17 18:00:13 +03:00
|
|
|
|
2001-07-08 11:00:23 +04:00
|
|
|
Version = '1.2.3'
|
2001-12-13 22:15:21 +03:00
|
|
|
Revision = %q$Revision$.split(/\s+/)[1]
|
2000-02-21 18:27:49 +03:00
|
|
|
|
1999-12-17 18:00:13 +03:00
|
|
|
class << self
|
|
|
|
|
2001-08-17 07:08:45 +04:00
|
|
|
def start( address, port = nil, *args )
|
1999-12-29 14:14:04 +03:00
|
|
|
instance = new( address, port )
|
1999-12-17 18:00:13 +03:00
|
|
|
|
2000-09-12 09:37:38 +04:00
|
|
|
if block_given? then
|
1999-12-29 14:14:04 +03:00
|
|
|
instance.start( *args ) { yield instance }
|
1999-12-17 18:00:13 +03:00
|
|
|
else
|
2000-08-16 23:26:07 +04:00
|
|
|
instance.start( *args )
|
1999-12-29 14:14:04 +03:00
|
|
|
instance
|
1999-12-17 18:00:13 +03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
1999-12-29 14:14:04 +03:00
|
|
|
def protocol_param( name, val )
|
1999-12-17 18:00:13 +03:00
|
|
|
module_eval %-
|
|
|
|
def self.#{name.id2name}
|
|
|
|
#{val}
|
|
|
|
end
|
|
|
|
-
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
#
|
2001-06-27 03:49:21 +04:00
|
|
|
# --- Configuration Staffs for Sub Classes ---
|
|
|
|
#
|
|
|
|
# protocol_param port
|
|
|
|
# protocol_param command_type
|
|
|
|
# protocol_param socket_type (optional)
|
1999-12-17 18:00:13 +03:00
|
|
|
#
|
2001-06-27 03:49:21 +04:00
|
|
|
# private method do_start (optional)
|
|
|
|
# private method do_finish (optional)
|
1999-12-17 18:00:13 +03:00
|
|
|
#
|
2001-06-27 03:49:21 +04:00
|
|
|
# private method on_connect (optional)
|
|
|
|
# private method on_disconnect (optional)
|
1999-12-17 18:00:13 +03:00
|
|
|
#
|
|
|
|
|
1999-12-29 14:14:04 +03:00
|
|
|
protocol_param :port, 'nil'
|
|
|
|
protocol_param :command_type, 'nil'
|
2001-12-20 08:00:20 +03:00
|
|
|
protocol_param :socket_type, '::Net::BufferedSocket'
|
1999-12-17 18:00:13 +03:00
|
|
|
|
|
|
|
|
2001-08-17 07:08:45 +04:00
|
|
|
def initialize( addr, port = nil )
|
2001-12-07 13:04:25 +03:00
|
|
|
@address = addr
|
2000-03-27 19:52:27 +04:00
|
|
|
@port = port || type.port
|
1999-12-17 18:00:13 +03:00
|
|
|
|
1999-12-29 14:14:04 +03:00
|
|
|
@command = nil
|
1999-12-17 18:00:13 +03:00
|
|
|
@socket = nil
|
2000-12-22 21:40:55 +03:00
|
|
|
|
2001-02-06 14:14:51 +03:00
|
|
|
@active = false
|
|
|
|
|
|
|
|
@open_timeout = nil
|
|
|
|
@read_timeout = nil
|
|
|
|
|
2001-02-07 20:17:51 +03:00
|
|
|
@dout = nil
|
1999-12-17 18:00:13 +03:00
|
|
|
end
|
|
|
|
|
2000-12-22 21:40:55 +03:00
|
|
|
attr_reader :address
|
|
|
|
attr_reader :port
|
|
|
|
|
|
|
|
attr_reader :command
|
|
|
|
attr_reader :socket
|
1999-12-17 18:00:13 +03:00
|
|
|
|
2001-02-06 14:14:51 +03:00
|
|
|
attr_accessor :open_timeout
|
|
|
|
attr_accessor :read_timeout
|
|
|
|
|
|
|
|
def active?
|
|
|
|
@active
|
|
|
|
end
|
|
|
|
|
2001-02-07 20:17:51 +03:00
|
|
|
def set_debug_output( arg ) # un-documented
|
|
|
|
@dout = arg
|
2001-02-06 14:14:51 +03:00
|
|
|
end
|
|
|
|
|
2001-02-07 20:17:51 +03:00
|
|
|
alias set_pipe set_debug_output
|
|
|
|
|
2000-06-12 20:42:46 +04:00
|
|
|
def inspect
|
|
|
|
"#<#{type} #{address}:#{port} open=#{active?}>"
|
|
|
|
end
|
|
|
|
|
2001-02-06 14:14:51 +03:00
|
|
|
#
|
|
|
|
# open session
|
|
|
|
#
|
1999-12-17 18:00:13 +03:00
|
|
|
|
1999-09-22 11:32:33 +04:00
|
|
|
def start( *args )
|
2001-07-03 23:03:16 +04:00
|
|
|
active? and raise IOError, 'protocol has been opened already'
|
1999-09-22 11:32:33 +04:00
|
|
|
|
2000-12-22 21:40:55 +03:00
|
|
|
if block_given? then
|
|
|
|
begin
|
|
|
|
_start args
|
|
|
|
yield self
|
|
|
|
ensure
|
2001-07-14 01:20:41 +04:00
|
|
|
finish if active?
|
2000-12-22 21:40:55 +03:00
|
|
|
end
|
|
|
|
else
|
|
|
|
_start args
|
1999-09-22 11:32:33 +04:00
|
|
|
end
|
2001-07-03 23:03:16 +04:00
|
|
|
nil
|
1999-09-22 11:32:33 +04:00
|
|
|
end
|
|
|
|
|
2001-02-06 14:14:51 +03:00
|
|
|
private
|
|
|
|
|
2000-12-22 21:40:55 +03:00
|
|
|
def _start( args )
|
|
|
|
connect
|
|
|
|
do_start( *args )
|
|
|
|
@active = true
|
|
|
|
end
|
|
|
|
|
2001-02-06 14:14:51 +03:00
|
|
|
def connect
|
|
|
|
conn_socket @address, @port
|
|
|
|
on_connect
|
2001-12-09 11:58:30 +03:00
|
|
|
conn_command @socket
|
2001-02-06 14:14:51 +03:00
|
|
|
end
|
1999-12-17 18:00:13 +03:00
|
|
|
|
2001-02-07 20:17:51 +03:00
|
|
|
def re_connect
|
|
|
|
@socket.reopen @open_timeout
|
|
|
|
on_connect
|
|
|
|
end
|
|
|
|
|
2001-02-06 14:14:51 +03:00
|
|
|
def conn_socket( addr, port )
|
|
|
|
@socket = type.socket_type.open(
|
2001-02-07 20:17:51 +03:00
|
|
|
addr, port, @open_timeout, @read_timeout, @dout )
|
1999-09-22 11:32:33 +04:00
|
|
|
end
|
|
|
|
|
2001-02-06 14:14:51 +03:00
|
|
|
def conn_command( sock )
|
|
|
|
@command = type.command_type.new( sock )
|
1999-12-17 18:00:13 +03:00
|
|
|
end
|
1999-09-22 11:32:33 +04:00
|
|
|
|
2001-02-06 14:14:51 +03:00
|
|
|
def on_connect
|
1999-10-13 11:29:15 +04:00
|
|
|
end
|
|
|
|
|
2001-02-06 14:14:51 +03:00
|
|
|
def do_start
|
|
|
|
end
|
1999-12-17 18:00:13 +03:00
|
|
|
|
2001-02-06 14:14:51 +03:00
|
|
|
#
|
|
|
|
# close session
|
|
|
|
#
|
1999-12-17 18:00:13 +03:00
|
|
|
|
2001-02-06 14:14:51 +03:00
|
|
|
public
|
1999-12-17 18:00:13 +03:00
|
|
|
|
2001-02-06 14:14:51 +03:00
|
|
|
def finish
|
2001-07-03 23:03:16 +04:00
|
|
|
active? or raise IOError, 'already closed protocol'
|
1999-12-17 18:00:13 +03:00
|
|
|
|
2001-02-06 14:14:51 +03:00
|
|
|
do_finish if @command and not @command.critical?
|
|
|
|
disconnect
|
|
|
|
@active = false
|
2001-07-03 23:03:16 +04:00
|
|
|
nil
|
1999-12-17 18:00:13 +03:00
|
|
|
end
|
|
|
|
|
2001-02-06 14:14:51 +03:00
|
|
|
private
|
1999-12-17 18:00:13 +03:00
|
|
|
|
2001-02-06 14:14:51 +03:00
|
|
|
def do_finish
|
|
|
|
@command.quit
|
1999-12-17 18:00:13 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
def disconnect
|
1999-12-29 14:14:04 +03:00
|
|
|
@command = nil
|
2000-03-05 13:25:53 +03:00
|
|
|
if @socket and not @socket.closed? then
|
|
|
|
@socket.close
|
|
|
|
end
|
2001-02-06 14:14:51 +03:00
|
|
|
@socket = nil
|
|
|
|
on_disconnect
|
|
|
|
end
|
|
|
|
|
|
|
|
def on_disconnect
|
1999-12-17 18:00:13 +03:00
|
|
|
end
|
2000-03-27 19:52:27 +04:00
|
|
|
|
1999-09-22 11:32:33 +04:00
|
|
|
end
|
|
|
|
|
1999-12-29 14:14:04 +03:00
|
|
|
Session = Protocol
|
|
|
|
|
1999-09-22 11:32:33 +04:00
|
|
|
|
2000-03-31 17:02:40 +04:00
|
|
|
class Response
|
1999-09-22 11:32:33 +04:00
|
|
|
|
2001-12-07 13:04:25 +03:00
|
|
|
def initialize( ctype, code, msg )
|
2000-03-31 17:02:40 +04:00
|
|
|
@code_type = ctype
|
2001-12-07 13:04:25 +03:00
|
|
|
@code = code
|
2000-03-31 17:02:40 +04:00
|
|
|
@message = msg
|
|
|
|
super()
|
2000-03-26 12:48:15 +04:00
|
|
|
end
|
|
|
|
|
2000-03-31 17:02:40 +04:00
|
|
|
attr_reader :code_type, :code, :message
|
|
|
|
alias msg message
|
1999-09-22 11:32:33 +04:00
|
|
|
|
2000-06-12 20:42:46 +04:00
|
|
|
def inspect
|
|
|
|
"#<#{type} #{code}>"
|
|
|
|
end
|
|
|
|
|
2001-06-27 03:49:21 +04:00
|
|
|
def error!
|
2001-12-13 22:15:21 +03:00
|
|
|
raise @code_type.error_type.new( code + ' ' + Net.quote(msg), self )
|
1999-09-22 11:32:33 +04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2000-03-31 17:02:40 +04:00
|
|
|
class ProtocolError < StandardError; end
|
|
|
|
class ProtoSyntaxError < ProtocolError; end
|
|
|
|
class ProtoFatalError < ProtocolError; end
|
|
|
|
class ProtoUnknownError < ProtocolError; end
|
|
|
|
class ProtoServerError < ProtocolError; end
|
|
|
|
class ProtoAuthError < ProtocolError; end
|
|
|
|
class ProtoCommandError < ProtocolError; end
|
|
|
|
class ProtoRetriableError < ProtocolError; end
|
|
|
|
ProtocRetryError = ProtoRetriableError
|
1999-12-17 18:00:13 +03:00
|
|
|
|
2000-06-09 11:53:59 +04:00
|
|
|
class ProtocolError
|
|
|
|
|
2001-06-27 03:49:21 +04:00
|
|
|
def initialize( msg, resp )
|
2000-06-09 11:53:59 +04:00
|
|
|
super msg
|
2001-06-27 03:49:21 +04:00
|
|
|
@response = resp
|
2000-06-09 11:53:59 +04:00
|
|
|
end
|
|
|
|
|
2001-06-27 03:49:21 +04:00
|
|
|
attr :response
|
|
|
|
alias data response
|
2000-06-12 20:42:46 +04:00
|
|
|
|
|
|
|
def inspect
|
|
|
|
"#<#{type}>"
|
|
|
|
end
|
2000-06-09 11:53:59 +04:00
|
|
|
|
|
|
|
end
|
|
|
|
|
1999-12-17 18:00:13 +03:00
|
|
|
|
2000-03-31 17:02:40 +04:00
|
|
|
class Code
|
1999-12-17 18:00:13 +03:00
|
|
|
|
2000-03-31 17:02:40 +04:00
|
|
|
def initialize( paren, err )
|
2001-12-13 22:15:21 +03:00
|
|
|
@parents = [self] + paren
|
2000-03-31 17:02:40 +04:00
|
|
|
@err = err
|
|
|
|
end
|
1999-12-17 18:00:13 +03:00
|
|
|
|
2001-12-13 22:15:21 +03:00
|
|
|
def parents
|
|
|
|
@parents.dup
|
|
|
|
end
|
2000-03-31 17:02:40 +04:00
|
|
|
|
2000-06-12 20:42:46 +04:00
|
|
|
def inspect
|
2001-12-13 22:15:21 +03:00
|
|
|
"#<#{type} #{sprintf '0x%x', __id__}>"
|
2000-06-12 20:42:46 +04:00
|
|
|
end
|
|
|
|
|
2000-03-31 17:02:40 +04:00
|
|
|
def error_type
|
|
|
|
@err
|
|
|
|
end
|
|
|
|
|
|
|
|
def ===( response )
|
2001-12-13 22:15:21 +03:00
|
|
|
response.code_type.parents.each {|c| return true if c == self }
|
2000-03-31 17:02:40 +04:00
|
|
|
false
|
|
|
|
end
|
1999-12-22 16:49:13 +03:00
|
|
|
|
2000-03-31 17:02:40 +04:00
|
|
|
def mkchild( err = nil )
|
2001-12-13 22:15:21 +03:00
|
|
|
type.new( @parents, err || @err )
|
2000-03-31 17:02:40 +04:00
|
|
|
end
|
|
|
|
|
1999-09-22 11:32:33 +04:00
|
|
|
end
|
2000-03-31 17:02:40 +04:00
|
|
|
|
|
|
|
ReplyCode = Code.new( [], ProtoUnknownError )
|
2000-10-11 09:27:56 +04:00
|
|
|
InformationCode = ReplyCode.mkchild( ProtoUnknownError )
|
2000-03-31 17:02:40 +04:00
|
|
|
SuccessCode = ReplyCode.mkchild( ProtoUnknownError )
|
|
|
|
ContinueCode = ReplyCode.mkchild( ProtoUnknownError )
|
|
|
|
ErrorCode = ReplyCode.mkchild( ProtocolError )
|
|
|
|
SyntaxErrorCode = ErrorCode.mkchild( ProtoSyntaxError )
|
|
|
|
FatalErrorCode = ErrorCode.mkchild( ProtoFatalError )
|
|
|
|
ServerErrorCode = ErrorCode.mkchild( ProtoServerError )
|
2000-04-25 13:23:21 +04:00
|
|
|
AuthErrorCode = ErrorCode.mkchild( ProtoAuthError )
|
2000-03-31 17:02:40 +04:00
|
|
|
RetriableCode = ReplyCode.mkchild( ProtoRetriableError )
|
|
|
|
UnknownCode = ReplyCode.mkchild( ProtoUnknownError )
|
1999-09-22 11:32:33 +04:00
|
|
|
|
|
|
|
|
2000-02-21 18:27:49 +03:00
|
|
|
|
|
|
|
class WriteAdapter
|
|
|
|
|
|
|
|
def initialize( sock, mid )
|
2001-12-13 22:15:21 +03:00
|
|
|
@socket = sock
|
2000-02-21 18:27:49 +03:00
|
|
|
@mid = mid
|
|
|
|
end
|
|
|
|
|
2000-06-12 20:42:46 +04:00
|
|
|
def inspect
|
|
|
|
"#<#{type}>"
|
|
|
|
end
|
|
|
|
|
2000-02-21 18:27:49 +03:00
|
|
|
def write( str )
|
2001-12-13 22:15:21 +03:00
|
|
|
@socket.__send__ @mid, str
|
2000-02-21 18:27:49 +03:00
|
|
|
end
|
2001-02-06 14:14:51 +03:00
|
|
|
|
2001-03-13 08:48:58 +03:00
|
|
|
def <<( str )
|
2001-12-13 22:15:21 +03:00
|
|
|
@socket.__send__ @mid, str
|
2001-03-13 08:48:58 +03:00
|
|
|
self
|
|
|
|
end
|
2000-02-21 18:27:49 +03:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
class ReadAdapter
|
|
|
|
|
|
|
|
def initialize( block )
|
|
|
|
@block = block
|
|
|
|
end
|
|
|
|
|
2000-06-12 20:42:46 +04:00
|
|
|
def inspect
|
|
|
|
"#<#{type}>"
|
|
|
|
end
|
|
|
|
|
2000-02-21 18:27:49 +03:00
|
|
|
def <<( str )
|
2000-11-16 17:03:20 +03:00
|
|
|
callblock( str, &@block ) if @block
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def callblock( str )
|
|
|
|
begin
|
|
|
|
user_break = true
|
|
|
|
yield str
|
|
|
|
user_break = false
|
|
|
|
rescue Exception
|
|
|
|
user_break = false
|
|
|
|
raise
|
|
|
|
ensure
|
|
|
|
if user_break then
|
|
|
|
@block = nil
|
2001-12-13 22:15:21 +03:00
|
|
|
return # stop breaking
|
2000-11-16 17:03:20 +03:00
|
|
|
end
|
|
|
|
end
|
2000-02-21 18:27:49 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2000-11-16 17:03:20 +03:00
|
|
|
|
aamine
* lib/net/protocol.rb, smtp.rb, pop.rb, http.rb: 1.1.26.
* lib/net/protocol.rb, smtp.rb, pop.rb, http.rb:
add module Net::NetPrivate and its inner classes
{Read,Write}Adapter, Command, Socket,
SMTPCommand, POP3Command, APOPCommand, HTTPCommand
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2000-07-12 10:04:40 +04:00
|
|
|
class Command
|
|
|
|
|
|
|
|
def initialize( sock )
|
|
|
|
@socket = sock
|
|
|
|
@last_reply = nil
|
|
|
|
@critical = false
|
|
|
|
end
|
|
|
|
|
|
|
|
attr_accessor :socket
|
|
|
|
attr_reader :last_reply
|
|
|
|
|
|
|
|
def inspect
|
|
|
|
"#<#{type}>"
|
|
|
|
end
|
|
|
|
|
|
|
|
# abstract quit
|
|
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
# abstract get_reply()
|
|
|
|
|
|
|
|
def check_reply( *oks )
|
|
|
|
@last_reply = get_reply
|
|
|
|
reply_must( @last_reply, *oks )
|
|
|
|
end
|
|
|
|
|
|
|
|
def reply_must( rep, *oks )
|
|
|
|
oks.each do |i|
|
|
|
|
if i === rep then
|
|
|
|
return rep
|
|
|
|
end
|
|
|
|
end
|
|
|
|
rep.error!
|
|
|
|
end
|
|
|
|
|
2000-12-22 21:40:55 +03:00
|
|
|
def getok( line, expect = SuccessCode )
|
aamine
* lib/net/protocol.rb, smtp.rb, pop.rb, http.rb: 1.1.26.
* lib/net/protocol.rb, smtp.rb, pop.rb, http.rb:
add module Net::NetPrivate and its inner classes
{Read,Write}Adapter, Command, Socket,
SMTPCommand, POP3Command, APOPCommand, HTTPCommand
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2000-07-12 10:04:40 +04:00
|
|
|
@socket.writeline line
|
2000-12-22 21:40:55 +03:00
|
|
|
check_reply expect
|
aamine
* lib/net/protocol.rb, smtp.rb, pop.rb, http.rb: 1.1.26.
* lib/net/protocol.rb, smtp.rb, pop.rb, http.rb:
add module Net::NetPrivate and its inner classes
{Read,Write}Adapter, Command, Socket,
SMTPCommand, POP3Command, APOPCommand, HTTPCommand
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2000-07-12 10:04:40 +04:00
|
|
|
end
|
|
|
|
|
|
|
|
|
2000-12-22 21:40:55 +03:00
|
|
|
#
|
|
|
|
# error handle
|
|
|
|
#
|
|
|
|
|
|
|
|
public
|
|
|
|
|
|
|
|
def critical?
|
|
|
|
@critical
|
|
|
|
end
|
|
|
|
|
|
|
|
def error_ok
|
|
|
|
@critical = false
|
|
|
|
end
|
|
|
|
|
2001-02-06 14:14:51 +03:00
|
|
|
|
2000-12-22 21:40:55 +03:00
|
|
|
private
|
|
|
|
|
aamine
* lib/net/protocol.rb, smtp.rb, pop.rb, http.rb: 1.1.26.
* lib/net/protocol.rb, smtp.rb, pop.rb, http.rb:
add module Net::NetPrivate and its inner classes
{Read,Write}Adapter, Command, Socket,
SMTPCommand, POP3Command, APOPCommand, HTTPCommand
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2000-07-12 10:04:40 +04:00
|
|
|
def critical
|
|
|
|
@critical = true
|
2000-10-25 21:40:30 +04:00
|
|
|
ret = yield
|
aamine
* lib/net/protocol.rb, smtp.rb, pop.rb, http.rb: 1.1.26.
* lib/net/protocol.rb, smtp.rb, pop.rb, http.rb:
add module Net::NetPrivate and its inner classes
{Read,Write}Adapter, Command, Socket,
SMTPCommand, POP3Command, APOPCommand, HTTPCommand
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2000-07-12 10:04:40 +04:00
|
|
|
@critical = false
|
2000-10-25 21:40:30 +04:00
|
|
|
ret
|
aamine
* lib/net/protocol.rb, smtp.rb, pop.rb, http.rb: 1.1.26.
* lib/net/protocol.rb, smtp.rb, pop.rb, http.rb:
add module Net::NetPrivate and its inner classes
{Read,Write}Adapter, Command, Socket,
SMTPCommand, POP3Command, APOPCommand, HTTPCommand
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2000-07-12 10:04:40 +04:00
|
|
|
end
|
|
|
|
|
|
|
|
def begin_critical
|
|
|
|
ret = @critical
|
|
|
|
@critical = true
|
|
|
|
not ret
|
|
|
|
end
|
|
|
|
|
|
|
|
def end_critical
|
|
|
|
@critical = false
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2001-12-20 08:00:20 +03:00
|
|
|
class BufferedSocket
|
1999-12-17 18:00:13 +03:00
|
|
|
|
2001-02-07 20:17:51 +03:00
|
|
|
def initialize( addr, port, otime = nil, rtime = nil, dout = nil )
|
1999-12-17 18:00:13 +03:00
|
|
|
@addr = addr
|
|
|
|
@port = port
|
2001-02-06 14:14:51 +03:00
|
|
|
|
|
|
|
@read_timeout = rtime
|
|
|
|
|
2001-02-07 20:17:51 +03:00
|
|
|
@debugout = dout
|
1999-12-17 18:00:13 +03:00
|
|
|
|
2001-02-23 02:23:57 +03:00
|
|
|
@socket = nil
|
1999-12-17 18:00:13 +03:00
|
|
|
@sending = ''
|
2001-12-13 22:15:21 +03:00
|
|
|
@rbuf = ''
|
1999-12-17 18:00:13 +03:00
|
|
|
|
2001-02-23 02:23:57 +03:00
|
|
|
connect otime
|
|
|
|
D 'opened'
|
|
|
|
end
|
|
|
|
|
|
|
|
def connect( otime )
|
|
|
|
D "opening connection to #{@addr}..."
|
2001-02-06 14:14:51 +03:00
|
|
|
timeout( otime ) {
|
2001-02-23 02:23:57 +03:00
|
|
|
@socket = TCPsocket.new( @addr, @port )
|
2001-02-06 14:14:51 +03:00
|
|
|
}
|
1999-12-17 18:00:13 +03:00
|
|
|
end
|
2001-02-23 02:23:57 +03:00
|
|
|
private :connect
|
1999-12-17 18:00:13 +03:00
|
|
|
|
|
|
|
attr :pipe, true
|
|
|
|
|
|
|
|
class << self
|
|
|
|
alias open new
|
|
|
|
end
|
|
|
|
|
2000-06-12 20:42:46 +04:00
|
|
|
def inspect
|
2001-02-23 02:23:57 +03:00
|
|
|
"#<#{type} #{closed? ? 'closed' : 'opened'}>"
|
2000-06-12 20:42:46 +04:00
|
|
|
end
|
|
|
|
|
2001-02-07 10:23:09 +03:00
|
|
|
def reopen( otime = nil )
|
2001-02-23 02:23:57 +03:00
|
|
|
D 'reopening...'
|
|
|
|
close
|
|
|
|
connect otime
|
|
|
|
D 'reopened'
|
1999-12-17 18:00:13 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
attr :socket, true
|
|
|
|
|
|
|
|
def close
|
2001-02-23 02:23:57 +03:00
|
|
|
if @socket then
|
|
|
|
@socket.close
|
|
|
|
D 'closed'
|
|
|
|
else
|
|
|
|
D 'close call for already closed socket'
|
|
|
|
end
|
|
|
|
@socket = nil
|
2001-12-13 22:15:21 +03:00
|
|
|
@rbuf = ''
|
1999-12-17 18:00:13 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
def closed?
|
2001-02-23 02:23:57 +03:00
|
|
|
not @socket
|
1999-12-17 18:00:13 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
def address
|
|
|
|
@addr.dup
|
|
|
|
end
|
2000-11-16 17:03:20 +03:00
|
|
|
|
1999-12-17 18:00:13 +03:00
|
|
|
alias addr address
|
|
|
|
|
2000-03-05 13:25:53 +03:00
|
|
|
attr_reader :port
|
1999-12-17 18:00:13 +03:00
|
|
|
|
|
|
|
def ip_address
|
2001-02-23 02:23:57 +03:00
|
|
|
@socket or return ''
|
|
|
|
@socket.addr[3]
|
1999-12-17 18:00:13 +03:00
|
|
|
end
|
2000-11-16 17:03:20 +03:00
|
|
|
|
1999-12-17 18:00:13 +03:00
|
|
|
alias ipaddr ip_address
|
|
|
|
|
2000-03-05 13:25:53 +03:00
|
|
|
attr_reader :sending
|
1999-12-17 18:00:13 +03:00
|
|
|
|
|
|
|
|
2001-02-06 14:14:51 +03:00
|
|
|
#
|
2001-12-13 22:15:21 +03:00
|
|
|
# input
|
2001-02-06 14:14:51 +03:00
|
|
|
#
|
|
|
|
|
|
|
|
public
|
2000-11-16 17:03:20 +03:00
|
|
|
|
|
|
|
CRLF = "\r\n"
|
1999-12-17 18:00:13 +03:00
|
|
|
|
2001-07-08 11:00:23 +04:00
|
|
|
def read( len, dest = '', igneof = false )
|
2001-02-23 02:23:57 +03:00
|
|
|
D_off "reading #{len} bytes..."
|
1999-12-17 18:00:13 +03:00
|
|
|
|
1999-09-22 11:32:33 +04:00
|
|
|
rsize = 0
|
2001-01-16 10:57:43 +03:00
|
|
|
begin
|
2001-12-13 22:15:21 +03:00
|
|
|
while rsize + @rbuf.size < len do
|
|
|
|
rsize += rbuf_moveto( dest, @rbuf.size )
|
2001-02-07 20:17:51 +03:00
|
|
|
rbuf_fill
|
2001-01-16 10:57:43 +03:00
|
|
|
end
|
2001-02-07 20:17:51 +03:00
|
|
|
rbuf_moveto dest, len - rsize
|
2001-01-16 10:57:43 +03:00
|
|
|
rescue EOFError
|
2001-02-06 14:14:51 +03:00
|
|
|
raise unless igneof
|
1999-09-22 11:32:33 +04:00
|
|
|
end
|
|
|
|
|
2001-02-23 02:23:57 +03:00
|
|
|
D_on "read #{len} bytes"
|
2000-03-31 17:02:40 +04:00
|
|
|
dest
|
1999-09-22 11:32:33 +04:00
|
|
|
end
|
|
|
|
|
2000-03-31 17:02:40 +04:00
|
|
|
def read_all( dest = '' )
|
2001-02-23 02:23:57 +03:00
|
|
|
D_off 'reading all...'
|
2000-01-21 15:52:24 +03:00
|
|
|
|
|
|
|
rsize = 0
|
|
|
|
begin
|
|
|
|
while true do
|
2001-12-13 22:15:21 +03:00
|
|
|
rsize += rbuf_moveto( dest, @rbuf.size )
|
2001-02-07 20:17:51 +03:00
|
|
|
rbuf_fill
|
2000-01-21 15:52:24 +03:00
|
|
|
end
|
|
|
|
rescue EOFError
|
|
|
|
;
|
|
|
|
end
|
|
|
|
|
2001-02-23 02:23:57 +03:00
|
|
|
D_on "read #{rsize} bytes"
|
2000-03-31 17:02:40 +04:00
|
|
|
dest
|
2000-01-21 15:52:24 +03:00
|
|
|
end
|
|
|
|
|
2001-02-06 14:14:51 +03:00
|
|
|
def readuntil( target, igneof = false )
|
2000-03-31 17:02:40 +04:00
|
|
|
dest = ''
|
2001-01-16 10:57:43 +03:00
|
|
|
begin
|
|
|
|
while true do
|
2001-12-13 22:15:21 +03:00
|
|
|
idx = @rbuf.index( target )
|
2001-01-16 10:57:43 +03:00
|
|
|
break if idx
|
2001-02-07 20:17:51 +03:00
|
|
|
rbuf_fill
|
2001-01-16 10:57:43 +03:00
|
|
|
end
|
2001-02-07 20:17:51 +03:00
|
|
|
rbuf_moveto dest, idx + target.size
|
2001-01-16 10:57:43 +03:00
|
|
|
rescue EOFError
|
2001-02-06 14:14:51 +03:00
|
|
|
raise unless igneof
|
2001-12-13 22:15:21 +03:00
|
|
|
rbuf_moveto dest, @rbuf.size
|
2001-01-16 10:57:43 +03:00
|
|
|
end
|
2000-03-31 17:02:40 +04:00
|
|
|
dest
|
1999-09-22 11:32:33 +04:00
|
|
|
end
|
|
|
|
|
|
|
|
def readline
|
2000-11-18 08:04:36 +03:00
|
|
|
ret = readuntil( "\n" )
|
1999-09-22 11:32:33 +04:00
|
|
|
ret.chop!
|
1999-12-17 18:00:13 +03:00
|
|
|
ret
|
1999-09-22 11:32:33 +04:00
|
|
|
end
|
|
|
|
|
2000-03-31 17:02:40 +04:00
|
|
|
def read_pendstr( dest )
|
2001-02-23 02:23:57 +03:00
|
|
|
D_off 'reading text...'
|
1999-09-22 11:32:33 +04:00
|
|
|
|
|
|
|
rsize = 0
|
2000-11-16 17:03:20 +03:00
|
|
|
while (str = readuntil("\r\n")) != ".\r\n" do
|
1999-09-22 11:32:33 +04:00
|
|
|
rsize += str.size
|
2000-06-16 17:47:38 +04:00
|
|
|
str.gsub!( /\A\./, '' )
|
1999-09-22 11:32:33 +04:00
|
|
|
dest << str
|
|
|
|
end
|
|
|
|
|
2001-02-23 02:23:57 +03:00
|
|
|
D_on "read #{rsize} bytes"
|
1999-12-17 18:00:13 +03:00
|
|
|
dest
|
1999-09-22 11:32:33 +04:00
|
|
|
end
|
|
|
|
|
2000-11-16 17:03:20 +03:00
|
|
|
# private use only (can not handle 'break')
|
1999-09-22 11:32:33 +04:00
|
|
|
def read_pendlist
|
2001-06-27 03:49:21 +04:00
|
|
|
# D_off 'reading list...'
|
1999-10-13 11:29:15 +04:00
|
|
|
|
1999-09-22 11:32:33 +04:00
|
|
|
str = nil
|
2000-11-16 17:03:20 +03:00
|
|
|
i = 0
|
|
|
|
while (str = readuntil("\r\n")) != ".\r\n" do
|
2000-11-18 08:04:36 +03:00
|
|
|
i += 1
|
1999-09-22 11:32:33 +04:00
|
|
|
str.chop!
|
2000-11-16 17:03:20 +03:00
|
|
|
yield str
|
1999-09-22 11:32:33 +04:00
|
|
|
end
|
|
|
|
|
2001-06-27 03:49:21 +04:00
|
|
|
# D_on "read #{i} items"
|
1999-09-22 11:32:33 +04:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2001-12-13 22:15:21 +03:00
|
|
|
BLOCK_SIZE = 1024 * 2
|
1999-09-22 11:32:33 +04:00
|
|
|
|
2001-02-07 20:17:51 +03:00
|
|
|
def rbuf_fill
|
2001-02-06 14:14:51 +03:00
|
|
|
unless IO.select [@socket], nil, nil, @read_timeout then
|
|
|
|
on_read_timeout
|
|
|
|
end
|
2001-12-13 22:15:21 +03:00
|
|
|
@rbuf << @socket.sysread(BLOCK_SIZE)
|
2001-02-06 14:14:51 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
def on_read_timeout
|
|
|
|
raise TimeoutError, "socket read timeout (#{@read_timeout} sec)"
|
1999-09-22 11:32:33 +04:00
|
|
|
end
|
|
|
|
|
2001-02-07 20:17:51 +03:00
|
|
|
def rbuf_moveto( dest, len )
|
2001-12-13 22:15:21 +03:00
|
|
|
dest << (s = @rbuf.slice!(0, len))
|
|
|
|
@debugout << %Q<read "#{Net.quote s}"\n> if @debugout
|
2000-01-21 15:52:24 +03:00
|
|
|
len
|
1999-12-17 18:00:13 +03:00
|
|
|
end
|
1999-09-22 11:32:33 +04:00
|
|
|
|
|
|
|
|
2001-02-06 14:14:51 +03:00
|
|
|
#
|
2001-12-13 22:15:21 +03:00
|
|
|
# output
|
2001-02-06 14:14:51 +03:00
|
|
|
#
|
2000-11-16 17:03:20 +03:00
|
|
|
|
1999-09-22 11:32:33 +04:00
|
|
|
public
|
|
|
|
|
2000-03-26 12:48:15 +04:00
|
|
|
def write( str )
|
2000-06-27 17:36:17 +04:00
|
|
|
writing {
|
|
|
|
do_write str
|
|
|
|
}
|
1999-09-22 11:32:33 +04:00
|
|
|
end
|
|
|
|
|
2000-03-26 12:48:15 +04:00
|
|
|
def writeline( str )
|
2000-06-27 17:36:17 +04:00
|
|
|
writing {
|
2001-03-08 11:39:40 +03:00
|
|
|
do_write str + "\r\n"
|
2000-06-27 17:36:17 +04:00
|
|
|
}
|
1999-09-22 11:32:33 +04:00
|
|
|
end
|
|
|
|
|
2000-03-31 17:02:40 +04:00
|
|
|
def write_bin( src, block )
|
2000-06-27 17:36:17 +04:00
|
|
|
writing {
|
|
|
|
if block then
|
2001-12-13 22:15:21 +03:00
|
|
|
block.call WriteAdapter.new(self, :do_write)
|
2000-06-27 17:36:17 +04:00
|
|
|
else
|
|
|
|
src.each do |bin|
|
|
|
|
do_write bin
|
|
|
|
end
|
2000-03-26 12:48:15 +04:00
|
|
|
end
|
2000-06-27 17:36:17 +04:00
|
|
|
}
|
1999-09-22 11:32:33 +04:00
|
|
|
end
|
|
|
|
|
2000-03-31 17:02:40 +04:00
|
|
|
def write_pendstr( src, block )
|
2001-02-23 02:23:57 +03:00
|
|
|
D_off "writing text from #{src.type}"
|
1999-09-22 11:32:33 +04:00
|
|
|
|
2001-12-13 22:15:21 +03:00
|
|
|
wsize = using_each_crlf_line {
|
2000-06-27 17:36:17 +04:00
|
|
|
if block then
|
2001-12-13 22:15:21 +03:00
|
|
|
block.call WriteAdapter.new(self, :wpend_in)
|
2000-06-27 17:36:17 +04:00
|
|
|
else
|
|
|
|
wpend_in src
|
|
|
|
end
|
|
|
|
}
|
1999-09-22 11:32:33 +04:00
|
|
|
|
2001-02-23 02:23:57 +03:00
|
|
|
D_on "wrote #{wsize} bytes text"
|
1999-12-17 18:00:13 +03:00
|
|
|
wsize
|
1999-09-22 11:32:33 +04:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2000-06-27 17:36:17 +04:00
|
|
|
def wpend_in( src )
|
|
|
|
line = nil
|
2000-08-16 23:26:07 +04:00
|
|
|
pre = @writtensize
|
2000-06-27 17:36:17 +04:00
|
|
|
each_crlf_line( src ) do |line|
|
|
|
|
do_write '.' if line[0] == ?.
|
|
|
|
do_write line
|
|
|
|
end
|
2000-08-16 23:26:07 +04:00
|
|
|
|
|
|
|
@writtensize - pre
|
2000-02-21 18:27:49 +03:00
|
|
|
end
|
|
|
|
|
2001-12-13 22:15:21 +03:00
|
|
|
def using_each_crlf_line
|
2000-06-27 17:36:17 +04:00
|
|
|
writing {
|
|
|
|
@wbuf = ''
|
2000-02-21 18:27:49 +03:00
|
|
|
|
2000-06-27 17:36:17 +04:00
|
|
|
yield
|
2000-02-21 18:27:49 +03:00
|
|
|
|
2001-12-13 22:15:21 +03:00
|
|
|
if not @wbuf.empty? then # unterminated last line
|
2000-06-27 17:36:17 +04:00
|
|
|
if @wbuf[-1] == ?\r then
|
|
|
|
@wbuf.chop!
|
|
|
|
end
|
|
|
|
@wbuf.concat "\r\n"
|
|
|
|
do_write @wbuf
|
|
|
|
elsif @writtensize == 0 then # empty src
|
|
|
|
do_write "\r\n"
|
|
|
|
end
|
|
|
|
do_write ".\r\n"
|
2000-02-21 18:27:49 +03:00
|
|
|
|
2000-06-27 17:36:17 +04:00
|
|
|
@wbuf = nil
|
|
|
|
}
|
|
|
|
end
|
1999-09-22 11:32:33 +04:00
|
|
|
|
2000-06-27 17:36:17 +04:00
|
|
|
def each_crlf_line( src )
|
2000-07-01 22:28:24 +04:00
|
|
|
str = m = beg = nil
|
1999-09-22 11:32:33 +04:00
|
|
|
|
2000-06-27 17:36:17 +04:00
|
|
|
adding( src ) do
|
2000-07-01 22:28:24 +04:00
|
|
|
beg = 0
|
2000-06-27 17:36:17 +04:00
|
|
|
buf = @wbuf
|
|
|
|
while buf.index( /\n|\r\n|\r/, beg ) do
|
2001-02-23 02:23:57 +03:00
|
|
|
m = Regexp.last_match
|
2000-06-27 17:36:17 +04:00
|
|
|
if m.begin(0) == buf.size - 1 and buf[-1] == ?\r then
|
2000-06-16 17:47:38 +04:00
|
|
|
# "...\r" : can follow "\n..."
|
|
|
|
break
|
|
|
|
end
|
2001-02-23 02:23:57 +03:00
|
|
|
str = buf[ beg ... m.begin(0) ]
|
2000-06-16 17:47:38 +04:00
|
|
|
str.concat "\r\n"
|
2000-06-27 17:36:17 +04:00
|
|
|
yield str
|
|
|
|
beg = m.end(0)
|
1999-09-22 11:32:33 +04:00
|
|
|
end
|
2001-02-23 02:23:57 +03:00
|
|
|
@wbuf = buf[ beg ... buf.size ]
|
1999-09-22 11:32:33 +04:00
|
|
|
end
|
2000-02-21 18:27:49 +03:00
|
|
|
end
|
|
|
|
|
2000-06-27 17:36:17 +04:00
|
|
|
def adding( src )
|
2000-02-21 18:27:49 +03:00
|
|
|
i = nil
|
|
|
|
|
|
|
|
case src
|
|
|
|
when String
|
2000-06-27 17:36:17 +04:00
|
|
|
0.step( src.size - 1, 2048 ) do |i|
|
|
|
|
@wbuf << src[i,2048]
|
2000-02-21 18:27:49 +03:00
|
|
|
yield
|
|
|
|
end
|
|
|
|
|
|
|
|
when File
|
2000-03-31 17:02:40 +04:00
|
|
|
while true do
|
2001-12-20 08:00:20 +03:00
|
|
|
i = src.read(2048)
|
2000-03-31 17:02:40 +04:00
|
|
|
break unless i
|
2000-06-27 17:36:17 +04:00
|
|
|
i[0,0] = @wbuf
|
|
|
|
@wbuf = i
|
2000-02-21 18:27:49 +03:00
|
|
|
yield
|
|
|
|
end
|
|
|
|
|
|
|
|
else
|
2000-06-27 17:36:17 +04:00
|
|
|
src.each do |i|
|
|
|
|
@wbuf << i
|
|
|
|
if @wbuf.size > 2048 then
|
|
|
|
yield
|
|
|
|
end
|
2000-02-21 18:27:49 +03:00
|
|
|
end
|
2001-01-13 22:07:15 +03:00
|
|
|
yield unless @wbuf.empty?
|
2000-02-21 18:27:49 +03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
1999-09-22 11:32:33 +04:00
|
|
|
|
2000-06-27 17:36:17 +04:00
|
|
|
def writing
|
1999-09-22 11:32:33 +04:00
|
|
|
@writtensize = 0
|
|
|
|
@sending = ''
|
2000-06-27 17:36:17 +04:00
|
|
|
|
|
|
|
yield
|
|
|
|
|
2001-02-07 20:17:51 +03:00
|
|
|
if @debugout then
|
|
|
|
@debugout << 'write "'
|
|
|
|
@debugout << @sending
|
|
|
|
@debugout << "\"\n"
|
2000-06-27 17:36:17 +04:00
|
|
|
end
|
|
|
|
@socket.flush
|
|
|
|
@writtensize
|
1999-09-22 11:32:33 +04:00
|
|
|
end
|
|
|
|
|
2000-06-27 17:36:17 +04:00
|
|
|
def do_write( arg )
|
2001-02-07 20:17:51 +03:00
|
|
|
if @debugout or @sending.size < 128 then
|
1999-12-17 18:00:13 +03:00
|
|
|
@sending << Net.quote( arg )
|
1999-09-22 11:32:33 +04:00
|
|
|
else
|
|
|
|
@sending << '...' unless @sending[-1] == ?.
|
|
|
|
end
|
1999-10-13 11:29:15 +04:00
|
|
|
|
1999-09-22 11:32:33 +04:00
|
|
|
s = @socket.write( arg )
|
|
|
|
@writtensize += s
|
1999-12-17 18:00:13 +03:00
|
|
|
s
|
1999-09-22 11:32:33 +04:00
|
|
|
end
|
|
|
|
|
2000-03-31 17:02:40 +04:00
|
|
|
|
2001-02-07 20:17:51 +03:00
|
|
|
def D_off( msg )
|
2001-02-23 02:23:57 +03:00
|
|
|
D msg
|
2001-02-07 20:17:51 +03:00
|
|
|
@savedo, @debugout = @debugout, nil
|
2000-03-31 17:02:40 +04:00
|
|
|
end
|
|
|
|
|
2001-02-07 20:17:51 +03:00
|
|
|
def D_on( msg )
|
|
|
|
@debugout = @savedo
|
2001-02-23 02:23:57 +03:00
|
|
|
D msg
|
|
|
|
end
|
|
|
|
|
|
|
|
def D( msg )
|
|
|
|
@debugout or return
|
|
|
|
@debugout << msg
|
|
|
|
@debugout << "\n"
|
2000-03-31 17:02:40 +04:00
|
|
|
end
|
|
|
|
|
1999-12-17 18:00:13 +03:00
|
|
|
end
|
1999-09-22 11:32:33 +04:00
|
|
|
|
aamine
* lib/net/protocol.rb, smtp.rb, pop.rb, http.rb: 1.1.26.
* lib/net/protocol.rb, smtp.rb, pop.rb, http.rb:
add module Net::NetPrivate and its inner classes
{Read,Write}Adapter, Command, Socket,
SMTPCommand, POP3Command, APOPCommand, HTTPCommand
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2000-07-12 10:04:40 +04:00
|
|
|
|
1999-12-17 18:00:13 +03:00
|
|
|
def Net.quote( str )
|
|
|
|
str = str.gsub( "\n", '\\n' )
|
|
|
|
str.gsub!( "\r", '\\r' )
|
|
|
|
str.gsub!( "\t", '\\t' )
|
|
|
|
str
|
1999-09-22 11:32:33 +04:00
|
|
|
end
|
|
|
|
|
2001-12-13 22:15:21 +03:00
|
|
|
|
|
|
|
# for backward compatibility
|
|
|
|
module NetPrivate
|
|
|
|
Response = ::Net::Response
|
|
|
|
WriteAdapter = ::Net::WriteAdapter
|
|
|
|
ReadAdapter = ::Net::ReadAdapter
|
|
|
|
Command = ::Net::Command
|
2001-12-20 08:00:20 +03:00
|
|
|
Socket = ::Net::BufferedSocket
|
2001-12-13 22:15:21 +03:00
|
|
|
end
|
|
|
|
|
1999-12-17 18:00:13 +03:00
|
|
|
end # module Net
|