mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 20:12:07 +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:
parent
2b9cbb978e
commit
af5f161fff
1 changed files with 6 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue