Commit 5e8f1f90 by wangguangchao

sysmod heap溢出问题修复提交

parent 13586e90
......@@ -53,7 +53,7 @@ void internalSetupEty()
Platform.dbCommit();
if( Platform.errorCode() > 0 )
{
Platform.sysDump( Platform.formatText( "Error occured on commiting the update of the user record.\n(Error=$1 $2)", Platform.errorCode(), Platform.getErrorText() ) );
//Platform.sysDump( Platform.formatText( "Error occured on commiting the update of the user record.\n(Error=$1 $2)", Platform.errorCode(), Platform.getErrorText() ) );
}
}
}
......
......@@ -13,9 +13,8 @@ init $$\ order 9000550
int ssn = 0;
String canTxt = NULLSTR;
boolean can = false;
SSNDone:
while(true){
SSNNew:
boolean SSNNewFlag = false;
SSNNewLabel:
while(true){
if( Platform.isEmpty( $\sysmod\ssn\inr ) )
{
......@@ -33,8 +32,9 @@ init $$\ order 9000550
if( ssnInrNumeric < 0 )
{
Platform.sysDump( Platform.formatText( "Invalid base 36 number '$1' passed following -SSNINR", ssnInr ) );
//return ; // #### goto SSNNew
break SSNNew;
//return ; // #######TODO 改写 LABEL与GOTO #### goto SSNNew
SSNNewFlag = true;
break SSNNewLabel;
}
Platform.setContext( tdContextSESSIONNUMBER, Platform.toString( ssnInrNumeric ) );
}
......@@ -83,8 +83,9 @@ init $$\ order 9000550
{
Platform.exitSession();
}
//return ; // #### goto SSNNew
break SSNNew;
//return ; // #######TODO 改写 LABEL与GOTO #### goto SSNNew
SSNNewFlag = true;
break SSNNewLabel;
}
}
// After having fixed the Session-Inr lock the Session record
......@@ -94,15 +95,17 @@ init $$\ order 9000550
{
$\sysmod\ssn\inr = "NO";
Platform.sysDump( Platform.formatText( "Unable to lock session ID upon start of transaction.\n(Error=$1 $2)", Platform.errorCode(), Platform.getErrorText() ) );
//return ; // #### goto SSNNew
break SSNNew;
//return ; // #######TODO 改写 LABEL与GOTO #### goto SSNNew
SSNNewFlag = true;
break SSNNewLabel;
}
// Load the Session record
Platform.dbRead( $\sysmod\ssn, $\sysmod\ssn\inr.getValue(), "INR" );
if( Platform.errorCode() == tdOdbcNotFound )
{
//return ; // #### goto SSNNew
break SSNNew;
//return ; // #######TODO 改写 LABEL与GOTO #### goto SSNNew
SSNNewFlag = true;
break SSNNewLabel;
}
else
{
......@@ -110,8 +113,9 @@ init $$\ order 9000550
{
Platform.sysDump( Platform.formatText( "Unable to read session ID upon start of transaction.\n(Error=$1 $2)", Platform.errorCode(), Platform.getErrorText() ) );
$\sysmod\ssn\inr = "NO";
//return ; // #### goto SSNNew
break SSNNew;
//return ; // #######TODO 改写 LABEL与GOTO #### goto SSNNew
SSNNewFlag = true;
break SSNNewLabel;
}
}
}
......@@ -123,8 +127,9 @@ init $$\ order 9000550
{
Platform.sysDump( Platform.formatText( "Inconsistent session data upon start of transaction.\nThe session record identifies the application server as $1, but it is $2.\nSession not registered.\n(Session INR used: $3)", $\sysmod\ssn\appsrv.getValue(), Platform.getContext( tdContextSERVERID ),$\sysmod\ssn\inr.getValue() ) );
$\sysmod\ssn\inr = "NO";
//return ; // #### goto SSNNew
break SSNNew;
//return ; // #######TODO 改写 LABEL与GOTO #### goto SSNNew
SSNNewFlag = true;
break SSNNewLabel;
}
}
else
......@@ -139,8 +144,9 @@ init $$\ order 9000550
{
Platform.sysDump( Platform.formatText( "Inconsistent session data upon start of transaction.\nThe session record identifies the application pid as $1, but it is $2.\nSession not registered.\n(Session INR used: $3)", $\sysmod\ssn\apppid.getValue(), Platform.getContext( tdContextSERVERPID ),$\sysmod\ssn\inr.getValue() ) );
$\sysmod\ssn\inr = "NO";
//return ; // #### goto SSNNew
break SSNNew;
//return ; // #######TODO 改写 LABEL与GOTO #### goto SSNNew
SSNNewFlag = true;
break SSNNewLabel;
}
}
else
......@@ -154,8 +160,9 @@ init $$\ order 9000550
{
Platform.sysDump( Platform.formatText( "Inconsistent session data upon start of transaction.\nThe session record identifies the user as $1, but it is $2.\nSession not registered.\n(Session INR used: $3)", $\sysmod\ssn\usr.getValue(), Platform.getLoginUser(), $\sysmod\ssn\inr.getValue() ) );
$\sysmod\ssn\inr = "NO";
//return ; // #### goto SSNNew
break SSNNew;
//return ; // #######TODO 改写 LABEL与GOTO #### goto SSNNew
SSNNewFlag = true;
break SSNNewLabel;
}
// to set an potential foldover user-id
$\sysmod\ssn\usr = Platform.getLoginUser();
......@@ -197,11 +204,12 @@ init $$\ order 9000550
Platform.sysDump( Platform.formatText( "Unable to update session record upon start of a transaction.\n(Session INR used: $3)\n(Error=$1 $2)", Platform.errorCode(), Platform.getErrorText(), $\sysmod\ssn\inr.getValue() ) );
}
}
//return ; // #### goto SSNDone
break SSNDone;
break SSNNewLabel;
}
//return ; // #######TODO 改写 LABEL与GOTO #### goto SSNDone
//------------------------
// #### label SSNNew
// #######TODO 改写 LABEL与GOTO #### label SSNNew
if(SSNNewFlag){
// Initial settings of a new session record
$\sysmod\ssn\begdattim = Platform.toDay();
$\sysmod\ssn\dissrv = Platform.getContext( tdContextCLIENTID ) + "-" + Platform.getClientType();
......@@ -271,9 +279,9 @@ init $$\ order 9000550
}
}
internalSetupSSN();
break SSNDone;
}
// #### label SSNDone
// #######TODO 改写 LABEL与GOTO #### label SSNDone
// Finally commit the database transaction handling the SSN-entry
// initialy -> creation of SSN
// all others -> update SSN with current transaction
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment