Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "relax validation on the presence of the 'shouldRetry' field w… #18

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/main/java/org/jitsi/xmpp/extensions/jibri/JibriIq.java
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,11 @@ protected IQ.IQChildElementXmlStringBuilder getIQChildElementBuilder(IQ.IQChildE
xml.optAttribute(SIP_ADDRESS_ATTR_NAME, sipAddress);
xml.optAttribute(SESSION_ID_ATTR_NAME, sessionId);
xml.optAttribute(FAILURE_REASON_ATTR_NAME, failureReason);
if (shouldRetry != null)
{
if (failureReason != null && failureReason != FailureReason.UNDEFINED) {
if (shouldRetry == null) {
throw new RuntimeException("shouldRetry field must be filled " +
"out when a failure reason is set");
}
xml.attribute(SHOULD_RETRY_ATTR_NAME, shouldRetry);
}
xml.optAttribute(APP_DATA_ATTR_NAME, appData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ public JibriIq parse(XmlPullParser parser, int depth)
{
iq.setShouldRetry(Boolean.valueOf(shouldRetryStr));
}
else if (iq.getFailureReason() != null
&& iq.getFailureReason() != JibriIq.FailureReason.UNDEFINED)
{
throw new RuntimeException("shouldRetry must be set if a " +
"failure reason is given");
}

String displayName
= parser.getAttributeValue("", JibriIq.DISPLAY_NAME_ATTR_NAME);
Expand Down