mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 14:22:05 +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
|
@Override
|
||||||
public void setReplyTimeout(long timeout) {
|
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();
|
private SmackConfiguration.UnknownIqRequestReplyMode unknownIqRequestReplyMode = SmackConfiguration.getUnknownIqRequestReplyMode();
|
||||||
|
|
Loading…
Reference in a new issue