improve wall filter

This commit is contained in:
wenshao
2013-04-05 22:32:54 +08:00
parent fe4c7a13aa
commit 707fe5214e
4 changed files with 37 additions and 35 deletions
@@ -355,7 +355,7 @@ public abstract class WallProvider {
WallContext originalContext = WallContext.current();
try {
WallContext.create(dbType);
WallContext.createIfNotExists(dbType);
return checkInternal(sql);
} finally {
if (originalContext == null) {
@@ -364,17 +364,11 @@ public abstract class WallProvider {
}
}
public WallCheckResult checkInternal(String sql) {
private WallCheckResult checkInternal(String sql) {
checkCount.incrementAndGet();
WallContext context = WallContext.current();
if (context != null && !this.dbType.equals(context.getDbType())) {
WallContext.clearContext();
}
WallContext.createIfNotExists(this.dbType);
if (config.isDoPrivilegedAllow() && ispPivileged()) {
return new WallCheckResult();
}