concurrent access bug corrected
This commit is contained in:
parent
d7185ee323
commit
5fd5f51349
|
@ -90,7 +90,7 @@ class Client < SAP
|
||||||
# verify response
|
# verify response
|
||||||
if connection_status==0x00 then
|
if connection_status==0x00 then
|
||||||
# OK, Server can fulfill requirements
|
# OK, Server can fulfill requirements
|
||||||
log("client","connected",3)
|
log("client","connected to server",3)
|
||||||
set_state :idle
|
set_state :idle
|
||||||
elsif connection_status==0x02 and message[:payload].size==2 then
|
elsif connection_status==0x02 and message[:payload].size==2 then
|
||||||
# Error, Server does not support maximum message size
|
# Error, Server does not support maximum message size
|
||||||
|
@ -107,7 +107,7 @@ class Client < SAP
|
||||||
@end=true
|
@end=true
|
||||||
when "STATUS_IND"
|
when "STATUS_IND"
|
||||||
status = message[:payload][0][:value][0]
|
status = message[:payload][0][:value][0]
|
||||||
log("client","new status : #{STATUS_CHANGE[status]}",3)
|
log("client","new card status : #{STATUS_CHANGE[status]}",3)
|
||||||
if status==0x01 then
|
if status==0x01 then
|
||||||
# card reset
|
# card reset
|
||||||
@sim_ok = true
|
@sim_ok = true
|
||||||
|
@ -153,7 +153,7 @@ class Client < SAP
|
||||||
connect = create_message("CONNECT_REQ",payload)
|
connect = create_message("CONNECT_REQ",payload)
|
||||||
send(connect)
|
send(connect)
|
||||||
set_state :connection_under_negociation
|
set_state :connection_under_negociation
|
||||||
elsif @state!=:connection_under_negociation
|
elsif @state!=:connection_under_negociation and @state!=:idle
|
||||||
raise "can not connect. required state : not_connected, current state : #{@state}"
|
raise "can not connect. required state : not_connected, current state : #{@state}"
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue