Commit 5e8f1f90 by wangguangchao

sysmod heap溢出问题修复提交

parent 13586e90
...@@ -53,7 +53,7 @@ void internalSetupEty() ...@@ -53,7 +53,7 @@ void internalSetupEty()
Platform.dbCommit(); Platform.dbCommit();
if( Platform.errorCode() > 0 ) 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 ...@@ -13,9 +13,8 @@ init $$\ order 9000550
int ssn = 0; int ssn = 0;
String canTxt = NULLSTR; String canTxt = NULLSTR;
boolean can = false; boolean can = false;
SSNDone: boolean SSNNewFlag = false;
while(true){ SSNNewLabel:
SSNNew:
while(true){ while(true){
if( Platform.isEmpty( $\sysmod\ssn\inr ) ) if( Platform.isEmpty( $\sysmod\ssn\inr ) )
{ {
...@@ -33,8 +32,9 @@ init $$\ order 9000550 ...@@ -33,8 +32,9 @@ init $$\ order 9000550
if( ssnInrNumeric < 0 ) if( ssnInrNumeric < 0 )
{ {
Platform.sysDump( Platform.formatText( "Invalid base 36 number '$1' passed following -SSNINR", ssnInr ) ); Platform.sysDump( Platform.formatText( "Invalid base 36 number '$1' passed following -SSNINR", ssnInr ) );
//return ; // #### goto SSNNew //return ; // #######TODO 改写 LABEL与GOTO #### goto SSNNew
break SSNNew; SSNNewFlag = true;
break SSNNewLabel;
} }
Platform.setContext( tdContextSESSIONNUMBER, Platform.toString( ssnInrNumeric ) ); Platform.setContext( tdContextSESSIONNUMBER, Platform.toString( ssnInrNumeric ) );
} }
...@@ -83,8 +83,9 @@ init $$\ order 9000550 ...@@ -83,8 +83,9 @@ init $$\ order 9000550
{ {
Platform.exitSession(); Platform.exitSession();
} }
//return ; // #### goto SSNNew //return ; // #######TODO 改写 LABEL与GOTO #### goto SSNNew
break SSNNew; SSNNewFlag = true;
break SSNNewLabel;
} }
} }
// After having fixed the Session-Inr lock the Session record // After having fixed the Session-Inr lock the Session record
...@@ -94,15 +95,17 @@ init $$\ order 9000550 ...@@ -94,15 +95,17 @@ init $$\ order 9000550
{ {
$\sysmod\ssn\inr = "NO"; $\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() ) ); Platform.sysDump( Platform.formatText( "Unable to lock session ID upon start of transaction.\n(Error=$1 $2)", Platform.errorCode(), Platform.getErrorText() ) );
//return ; // #### goto SSNNew //return ; // #######TODO 改写 LABEL与GOTO #### goto SSNNew
break SSNNew; SSNNewFlag = true;
break SSNNewLabel;
} }
// Load the Session record // Load the Session record
Platform.dbRead( $\sysmod\ssn, $\sysmod\ssn\inr.getValue(), "INR" ); Platform.dbRead( $\sysmod\ssn, $\sysmod\ssn\inr.getValue(), "INR" );
if( Platform.errorCode() == tdOdbcNotFound ) if( Platform.errorCode() == tdOdbcNotFound )
{ {
//return ; // #### goto SSNNew //return ; // #######TODO 改写 LABEL与GOTO #### goto SSNNew
break SSNNew; SSNNewFlag = true;
break SSNNewLabel;
} }
else else
{ {
...@@ -110,8 +113,9 @@ init $$\ order 9000550 ...@@ -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() ) ); 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"; $\sysmod\ssn\inr = "NO";
//return ; // #### goto SSNNew //return ; // #######TODO 改写 LABEL与GOTO #### goto SSNNew
break SSNNew; SSNNewFlag = true;
break SSNNewLabel;
} }
} }
} }
...@@ -123,8 +127,9 @@ init $$\ order 9000550 ...@@ -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() ) ); 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"; $\sysmod\ssn\inr = "NO";
//return ; // #### goto SSNNew //return ; // #######TODO 改写 LABEL与GOTO #### goto SSNNew
break SSNNew; SSNNewFlag = true;
break SSNNewLabel;
} }
} }
else else
...@@ -139,8 +144,9 @@ init $$\ order 9000550 ...@@ -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() ) ); 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"; $\sysmod\ssn\inr = "NO";
//return ; // #### goto SSNNew //return ; // #######TODO 改写 LABEL与GOTO #### goto SSNNew
break SSNNew; SSNNewFlag = true;
break SSNNewLabel;
} }
} }
else else
...@@ -154,8 +160,9 @@ init $$\ order 9000550 ...@@ -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() ) ); 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"; $\sysmod\ssn\inr = "NO";
//return ; // #### goto SSNNew //return ; // #######TODO 改写 LABEL与GOTO #### goto SSNNew
break SSNNew; SSNNewFlag = true;
break SSNNewLabel;
} }
// to set an potential foldover user-id // to set an potential foldover user-id
$\sysmod\ssn\usr = Platform.getLoginUser(); $\sysmod\ssn\usr = Platform.getLoginUser();
...@@ -197,11 +204,12 @@ init $$\ order 9000550 ...@@ -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() ) ); 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 SSNNewLabel;
break SSNDone;
} }
//return ; // #######TODO 改写 LABEL与GOTO #### goto SSNDone
//------------------------ //------------------------
// #### label SSNNew // #######TODO 改写 LABEL与GOTO #### label SSNNew
if(SSNNewFlag){
// Initial settings of a new session record // Initial settings of a new session record
$\sysmod\ssn\begdattim = Platform.toDay(); $\sysmod\ssn\begdattim = Platform.toDay();
$\sysmod\ssn\dissrv = Platform.getContext( tdContextCLIENTID ) + "-" + Platform.getClientType(); $\sysmod\ssn\dissrv = Platform.getContext( tdContextCLIENTID ) + "-" + Platform.getClientType();
...@@ -271,9 +279,9 @@ init $$\ order 9000550 ...@@ -271,9 +279,9 @@ init $$\ order 9000550
} }
} }
internalSetupSSN(); internalSetupSSN();
break SSNDone;
} }
// #### label SSNDone
// #######TODO 改写 LABEL与GOTO #### label SSNDone
// Finally commit the database transaction handling the SSN-entry // Finally commit the database transaction handling the SSN-entry
// initialy -> creation of SSN // initialy -> creation of SSN
// all others -> update SSN with current transaction // 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