mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 17:55:48 +08:00
put in changes to only keep the last terrain revision. The current
unbounded model causes performance and filesystem filling grief. Before enabling this again, we need a reasonable bounding model.
This commit is contained in:
@@ -280,6 +280,20 @@ namespace OpenSim.DataStore.MonoSqlite
|
||||
cmd.Parameters.Add(new SqliteParameter(":Heightfield", serializeTerrain(ter)));
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
// This is added to get rid of the infinitely growing
|
||||
// terrain databases which negatively impact on SQLite
|
||||
// over time. Before reenabling this feature there
|
||||
// needs to be a limitter put on the number of
|
||||
// revisions in the database, as this old
|
||||
// implementation is a DOS attack waiting to happen.
|
||||
|
||||
using(SqliteCommand cmd = new SqliteCommand("delete from terrain where RegionUUID=:RegionUUID and Revision < :Revision", conn))
|
||||
{
|
||||
cmd.Parameters.Add(new SqliteParameter(":RegionUUID", regionID.ToString()));
|
||||
cmd.Parameters.Add(new SqliteParameter(":Revision", revision));
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
conn.Close();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user