* 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:
parent
b9db231cbd
commit
73e0d386b8
@ -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>
|
Sat Jul 17 23:59:01 2004 Shugo Maeda <shugo@ruby-lang.org>
|
||||||
|
|
||||||
* lib/net/imap.rb (send_string_data): wait command continuation
|
* lib/net/imap.rb (send_string_data): wait command continuation
|
||||||
|
@ -898,12 +898,13 @@ module Net
|
|||||||
@response_handlers = []
|
@response_handlers = []
|
||||||
@tagged_response_arrival = new_cond
|
@tagged_response_arrival = new_cond
|
||||||
@continuation_request_arrival = new_cond
|
@continuation_request_arrival = new_cond
|
||||||
|
@logout_command_tag = nil
|
||||||
@debug_output_bol = true
|
@debug_output_bol = true
|
||||||
|
|
||||||
@greeting = get_response
|
@greeting = get_response
|
||||||
if /\ABYE\z/ni =~ @greeting.name
|
if @greeting.name == "BYE"
|
||||||
@sock.close
|
@sock.close
|
||||||
raise ByeResponseError, resp[0]
|
raise ByeResponseError, @greeting.raw_data
|
||||||
end
|
end
|
||||||
|
|
||||||
@client_thread = Thread.current
|
@client_thread = Thread.current
|
||||||
@ -928,12 +929,19 @@ module Net
|
|||||||
when TaggedResponse
|
when TaggedResponse
|
||||||
@tagged_responses[resp.tag] = resp
|
@tagged_responses[resp.tag] = resp
|
||||||
@tagged_response_arrival.broadcast
|
@tagged_response_arrival.broadcast
|
||||||
|
if resp.tag == @logout_command_tag
|
||||||
|
return
|
||||||
|
end
|
||||||
when UntaggedResponse
|
when UntaggedResponse
|
||||||
record_response(resp.name, resp.data)
|
record_response(resp.name, resp.data)
|
||||||
if resp.data.instance_of?(ResponseText) &&
|
if resp.data.instance_of?(ResponseText) &&
|
||||||
(code = resp.data.code)
|
(code = resp.data.code)
|
||||||
record_response(code.name, code.data)
|
record_response(code.name, code.data)
|
||||||
end
|
end
|
||||||
|
if resp.name == "BYE" && @logout_command_tag.nil?
|
||||||
|
@sock.close
|
||||||
|
raise ByeResponseError, resp.raw_data
|
||||||
|
end
|
||||||
when ContinuationRequest
|
when ContinuationRequest
|
||||||
@continuation_request_arrival.signal
|
@continuation_request_arrival.signal
|
||||||
end
|
end
|
||||||
@ -998,6 +1006,9 @@ module Net
|
|||||||
send_data(i)
|
send_data(i)
|
||||||
end
|
end
|
||||||
put_string(CRLF)
|
put_string(CRLF)
|
||||||
|
if cmd == "LOGOUT"
|
||||||
|
@logout_command_tag = tag
|
||||||
|
end
|
||||||
if block
|
if block
|
||||||
add_response_handler(block)
|
add_response_handler(block)
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user