Core: Some optimizations
- Declare some functions const - Fix some mem leak - Fix some resource leak - Remove unused variables and functions - Remove duplicate functions - Reduce the scope of some variables - Remove unused file --HG-- branch : trunk
This commit is contained in:
1 parent
e226c4ac34
commit
408fce1de6
73 files changed
+200
-712
No files matched your search
@@ -35,16 +35,11 @@
|
||||
}
|
||||
|
||||
/// RASocket constructor
|
||||
RASocket::RASocket(ISocketHandler &h): TcpSocket(h)
|
||||
RASocket::RASocket(ISocketHandler &h): TcpSocket(h), szLogin(""), iInputLength(0),
|
||||
bSecure(sConfig.GetBoolDefault("RA.Secure", true)), iMinLevel(sConfig.GetIntDefault("RA.MinLevel", 3)),
|
||||
stage(NONE)
|
||||
{
|
||||
|
||||
///- Get the config parameters
|
||||
bSecure = sConfig.GetBoolDefault( "RA.Secure", true );
|
||||
iMinLevel = sConfig.GetIntDefault( "RA.MinLevel", 3 );
|
||||
|
||||
///- Initialize buffer and data
|
||||
iInputLength=0;
|
||||
stage=NONE;
|
||||
*buff = '\0';
|
||||
}
|
||||
|
||||
/// RASocket destructor
|
||||
@@ -197,7 +192,7 @@ void RASocket::OnRead()
|
||||
break;
|
||||
///<li> If user is logged, parse and execute the command
|
||||
case OK:
|
||||
if (strlen(buff))
|
||||
if (*buff != '\0')
|
||||
{
|
||||
sLog.outRemote("Got '%s' cmd.\n",buff);
|
||||
SetDeleteByHandler(false);
|
||||
|
||||
Reference in new issue
Block a user