00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "ResponseCallback.h"
00019 #include "StateInfo.h"
00020 #include "ClientActivity.h"
00021
00022 using namespace CODEX_KeyService;
00023
00024 ResponseCallback::ResponseCallback( const unsigned char* seqNum )
00025 {
00026 memcpy( m_seqNum, seqNum, CODEX_Server::ServerState::nMID );
00027 }
00028
00029 ResponseCallback::~ResponseCallback()
00030 {
00031 StateInfo* stateInfo = StateInfo::instance();
00032 if ( NULL != stateInfo )
00033 {
00034 stateInfo->removeSequenceNumber(m_seqNum);
00035 }
00036 }
00037
00038 void
00039 ResponseCallback::fail()
00040 {
00041 CODEX_Server::ServerState* serverState =
00042 CODEX_Server::ServerState::instance();
00043 if ( 0 == serverState )
00044 {
00045 return;
00046 }
00047
00048 StateInfo* stateInfo = StateInfo::instance();
00049 if ( 0 == stateInfo )
00050 {
00051 return;
00052 }
00053
00054 CODEX_Events::Activity* act = stateInfo->getActFromSeqNum( m_seqNum );
00055 if ( 0 != act )
00056 {
00057 ClientActivity* ca = stateInfo->getClient( act );
00058 if ( 0 != ca )
00059 {
00060
00061 ca->close();
00062 }
00063 }
00064
00065
00066
00067 serverState->removeChallenge( m_seqNum );
00068 }