1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-24 03:27:59 +01:00

Prevent extremely long reply timeouts from being set.

Smack will throw an IllegalArguementException if extremely
long reply timeouts are tried to be set. I assumed currentTimeMilli()
to be the boundary condition as per SMACK-718
This commit is contained in:
adiaholic 2019-04-26 20:30:26 +05:30
parent 2b9cbb978e
commit af5f161fff

View file

@ -1146,7 +1146,12 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
@Override
public void setReplyTimeout(long timeout) {
replyTimeout = timeout;
if (Long.MAX_VALUE - System.currentTimeMillis() < timeout) {
throw new IllegalArgumentException("Extremely long reply timeout");
}
else {
replyTimeout = timeout;
}
}
private SmackConfiguration.UnknownIqRequestReplyMode unknownIqRequestReplyMode = SmackConfiguration.getUnknownIqRequestReplyMode();