From 5fd5f513492a309ba948857954d9d92df1c31426 Mon Sep 17 00:00:00 2001 From: Kevin Redon Date: Mon, 16 May 2011 12:54:14 +0200 Subject: [PATCH] concurrent access bug corrected --- src/sap/client.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sap/client.rb b/src/sap/client.rb index e3d0551..fdef683 100644 --- a/src/sap/client.rb +++ b/src/sap/client.rb @@ -90,7 +90,7 @@ class Client < SAP # verify response if connection_status==0x00 then # OK, Server can fulfill requirements - log("client","connected",3) + log("client","connected to server",3) set_state :idle elsif connection_status==0x02 and message[:payload].size==2 then # Error, Server does not support maximum message size @@ -107,7 +107,7 @@ class Client < SAP @end=true when "STATUS_IND" 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 # card reset @sim_ok = true @@ -153,7 +153,7 @@ class Client < SAP connect = create_message("CONNECT_REQ",payload) send(connect) 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}" return false end