diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs index fc6f59c..b00b734 100644 --- a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs +++ b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs | |||
@@ -280,6 +280,20 @@ namespace OpenSim.DataStore.MonoSqlite | |||
280 | cmd.Parameters.Add(new SqliteParameter(":Heightfield", serializeTerrain(ter))); | 280 | cmd.Parameters.Add(new SqliteParameter(":Heightfield", serializeTerrain(ter))); |
281 | cmd.ExecuteNonQuery(); | 281 | cmd.ExecuteNonQuery(); |
282 | } | 282 | } |
283 | |||
284 | // This is added to get rid of the infinitely growing | ||
285 | // terrain databases which negatively impact on SQLite | ||
286 | // over time. Before reenabling this feature there | ||
287 | // needs to be a limitter put on the number of | ||
288 | // revisions in the database, as this old | ||
289 | // implementation is a DOS attack waiting to happen. | ||
290 | |||
291 | using(SqliteCommand cmd = new SqliteCommand("delete from terrain where RegionUUID=:RegionUUID and Revision < :Revision", conn)) | ||
292 | { | ||
293 | cmd.Parameters.Add(new SqliteParameter(":RegionUUID", regionID.ToString())); | ||
294 | cmd.Parameters.Add(new SqliteParameter(":Revision", revision)); | ||
295 | cmd.ExecuteNonQuery(); | ||
296 | } | ||
283 | conn.Close(); | 297 | conn.Close(); |
284 | } | 298 | } |
285 | } | 299 | } |