summaryrefslogtreecommitdiff
path: root/lib/net/protocol.rb
diff options
context:
space:
mode:
authoraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-07-03 19:03:16 +0000
committeraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-07-03 19:03:16 +0000
commit9e79454b3d6476ff0da11ae7917b25edd8057f1d (patch)
tree12597b510228a84f98541f787c96a8c2a3807bdc /lib/net/protocol.rb
parentfa20d931bcd07a5f7d8ab80edc79419cae1d25fd (diff)
downloadruby-9e79454b3d6476ff0da11ae7917b25edd8057f1d.tar.gz
aamine
* lib/net/http.rb (HTTP#request_by_name): bug fix. * lib/net/http.rb: does not write Connection: by default. * lib/net/protocol.rb: "start" for started protocol is an error. * lib/net/protocol.rb: "finish" for finished protocol is an error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net/protocol.rb')
-rw-r--r--lib/net/protocol.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/net/protocol.rb b/lib/net/protocol.rb
index d810ac2f9d..aba2256b6e 100644
--- a/lib/net/protocol.rb
+++ b/lib/net/protocol.rb
@@ -122,7 +122,7 @@ module Net
#
def start( *args )
- return false if active?
+ active? and raise IOError, 'protocol has been opened already'
if block_given? then
begin
@@ -134,6 +134,7 @@ module Net
else
_start args
end
+ nil
end
private
@@ -177,12 +178,12 @@ module Net
public
def finish
- return false unless active?
+ active? or raise IOError, 'already closed protocol'
do_finish if @command and not @command.critical?
disconnect
@active = false
- true
+ nil
end
private