mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-24 03:27:59 +01:00
Merge pull request #308 from adiaholic/SMACK-718
Prevent extremely long reply timeouts from being set.
This commit is contained in:
commit
c6b75d8bcc
1 changed files with 6 additions and 1 deletions
|
@ -1192,7 +1192,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