mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-26 05:52:06 +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,8 +1192,13 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setReplyTimeout(long timeout) {
|
public void setReplyTimeout(long timeout) {
|
||||||
|
if (Long.MAX_VALUE - System.currentTimeMillis() < timeout) {
|
||||||
|
throw new IllegalArgumentException("Extremely long reply timeout");
|
||||||
|
}
|
||||||
|
else {
|
||||||
replyTimeout = timeout;
|
replyTimeout = timeout;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private SmackConfiguration.UnknownIqRequestReplyMode unknownIqRequestReplyMode = SmackConfiguration.getUnknownIqRequestReplyMode();
|
private SmackConfiguration.UnknownIqRequestReplyMode unknownIqRequestReplyMode = SmackConfiguration.getUnknownIqRequestReplyMode();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue