Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Openfire
Commits
3337e79d
Commit
3337e79d
authored
Jun 11, 2014
by
Christian Schudt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OF-823 Numeric overflow in MUCPersistenceManager when loading history older than 24 days.
parent
007dd25e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
MUCPersistenceManager.java
.../jivesoftware/openfire/muc/spi/MUCPersistenceManager.java
+3
-2
No files found.
src/java/org/jivesoftware/openfire/muc/spi/MUCPersistenceManager.java
View file @
3337e79d
...
...
@@ -20,6 +20,7 @@
package
org
.
jivesoftware
.
openfire
.
muc
.
spi
;
import
java.math.BigInteger
;
import
java.sql.Connection
;
import
java.sql.PreparedStatement
;
import
java.sql.ResultSet
;
...
...
@@ -229,7 +230,7 @@ public class MUCPersistenceManager {
pstmt
=
con
.
prepareStatement
(
LOAD_HISTORY
);
// Reload the history, using "muc.history.reload.limit" (days); defaults to 2
int
reloadLimitDays
=
JiveGlobals
.
getIntProperty
(
MUC_HISTORY_RELOAD_LIMIT
,
2
);
long
from
=
System
.
currentTimeMillis
()
-
(
86400000
*
reloadLimitDays
);
long
from
=
System
.
currentTimeMillis
()
-
(
BigInteger
.
valueOf
(
86400000
).
multiply
(
BigInteger
.
valueOf
(
reloadLimitDays
))).
longValue
(
);
pstmt
.
setString
(
1
,
StringUtils
.
dateToMillis
(
new
Date
(
from
)));
pstmt
.
setLong
(
2
,
room
.
getID
());
rs
=
pstmt
.
executeQuery
();
...
...
@@ -546,7 +547,7 @@ public class MUCPersistenceManager {
// if the property is defined, but not numeric, default to 2 (days)
int
reloadLimitDays
=
JiveGlobals
.
getIntProperty
(
MUC_HISTORY_RELOAD_LIMIT
,
2
);
Log
.
warn
(
"MUC history reload limit set to "
+
reloadLimitDays
+
" days"
);
from
=
System
.
currentTimeMillis
()
-
(
86400000
*
reloadLimitDays
);
from
=
System
.
currentTimeMillis
()
-
(
BigInteger
.
valueOf
(
86400000
).
multiply
(
BigInteger
.
valueOf
(
reloadLimitDays
))).
longValue
(
);
}
statement
.
setLong
(
1
,
serviceID
);
statement
.
setString
(
2
,
StringUtils
.
dateToMillis
(
new
Date
(
from
)));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment