1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/net/imap.rb (receive_responses): return if a LOGOUT response

received.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
shugo 2004-07-17 17:35:53 +00:00
parent b9db231cbd
commit 73e0d386b8
2 changed files with 18 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Sun Jul 18 02:35:30 2004 Shugo Maeda <shugo@ruby-lang.org>
* lib/net/imap.rb (receive_responses): return if a LOGOUT response
received.
Sat Jul 17 23:59:01 2004 Shugo Maeda <shugo@ruby-lang.org>
* lib/net/imap.rb (send_string_data): wait command continuation

View file

@ -898,12 +898,13 @@ module Net
@response_handlers = []
@tagged_response_arrival = new_cond
@continuation_request_arrival = new_cond
@logout_command_tag = nil
@debug_output_bol = true
@greeting = get_response
if /\ABYE\z/ni =~ @greeting.name
if @greeting.name == "BYE"
@sock.close
raise ByeResponseError, resp[0]
raise ByeResponseError, @greeting.raw_data
end
@client_thread = Thread.current
@ -928,12 +929,19 @@ module Net
when TaggedResponse
@tagged_responses[resp.tag] = resp
@tagged_response_arrival.broadcast
if resp.tag == @logout_command_tag
return
end
when UntaggedResponse
record_response(resp.name, resp.data)
if resp.data.instance_of?(ResponseText) &&
(code = resp.data.code)
record_response(code.name, code.data)
end
if resp.name == "BYE" && @logout_command_tag.nil?
@sock.close
raise ByeResponseError, resp.raw_data
end
when ContinuationRequest
@continuation_request_arrival.signal
end
@ -998,6 +1006,9 @@ module Net
send_data(i)
end
put_string(CRLF)
if cmd == "LOGOUT"
@logout_command_tag = tag
end
if block
add_response_handler(block)
end