Merge pull request #308 from adiaholic/SMACK-718
Prevent extremely long reply timeouts from being set.
This commit is contained in:
commit
c6b75d8bcc
|
@ -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 New Issue