1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-22 20:47:57 +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();