Patch level : 10.0

Files correlati     : authoriz
Ricompilazione Demo : [ ]
Commento            :
Corretta chiamata rpc DongleInfo


git-svn-id: svn://10.65.10.50/trunk@20144 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2010-02-18 16:35:22 +00:00
parent eaea8ecda8
commit 595d101161

View File

@ -150,7 +150,7 @@ class TAuthorizationServer : public TBaseServerApp
{
private:
TDongle m_Dongle;
unsigned long m_Modules[3];
unsigned long m_Modules[2];
unsigned int m_nModules;
wxString m_strLastPassword;
wxString m_strLastApp;
@ -197,7 +197,6 @@ void TAuthorizationServer::InitModules()
{
m_nModules = 0;
memset(m_Modules, 0, sizeof(m_Modules));
m_Modules[0] = 2*sizeof(long);
if (m_Dongle.Ok())
{
for (int i = 0; i < 48; i++)
@ -206,7 +205,7 @@ void TAuthorizationServer::InitModules()
{
const size_t index = i / 32;
const unsigned long mask = 1 << (i & 31);
m_Modules[index+1] |= mask;
m_Modules[index] |= mask;
m_nModules++;
}
}
@ -924,10 +923,10 @@ bool TAuthorizationServer::ProcessCommand(wxString cmd, wxSocketBase& outs)
const short num = m_Dongle.Number();
const short year = m_Dongle.YearAssist();
const size_t nBytes = sizeof(num) + sizeof(year) + sizeof(m_Modules);
outs.Write(&nBytes, sizeof(nBytes)); // 4 bytes = size of data
outs.Write(&num, sizeof(num)); // 2 bytes = dongle number
outs.Write(&year, sizeof(year)); // 2 bytes = dongle year
outs.Write(&m_Modules,sizeof(m_Modules)); // 12 bytes = active modules bits
outs.Write(&nBytes, sizeof(nBytes)); // 4 bytes = size of data
outs.Write(&num, sizeof(num)); // 2 bytes = dongle number
outs.Write(&year, sizeof(year)); // 2 bytes = dongle year
outs.Write(m_Modules, sizeof(m_Modules)); // 8 bytes = 64 active modules bits
return outs.IsOk();
}
@ -936,7 +935,9 @@ bool TAuthorizationServer::ProcessCommand(wxString cmd, wxSocketBase& outs)
if (cmd.StartsWith("DongleModules"))
{
outs.Write(m_Modules, sizeof(m_Modules));
const size_t nBytes = sizeof(m_Modules);
outs.Write(&nBytes, sizeof(nBytes)); // 4 bytes = size of data
outs.Write(m_Modules, sizeof(m_Modules)); // 8 bytes = data
return outs.IsOk();
}