-
Notifications
You must be signed in to change notification settings - Fork 886
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
Instant Stream Resumption implementation #92
base: master
Are you sure you want to change the base?
Conversation
hash.append(hex); | ||
} | ||
digest = hash.toString(); | ||
} catch (UnsupportedEncodingException e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never swallow Exceptions! Use a try/multi-catch and throw a unchecked exception, e.g. InvalidStateException in this case. In cases where the exception can be ignored, log it at least with a FINE/FINER/FINEST level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Flowdalic fixed
} catch (InvalidKeyException e) { | ||
} catch (NoSuchAlgorithmException e) { | ||
} catch (UnsupportedEncodingException | InvalidKeyException | NoSuchAlgorithmException e) { | ||
throw new IllegalStateException("HMAC digest couldn't be done correctly."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the catched Exception to the ISE, so that it doesn't get lost:
throw new IllegalStateException("HMAC digest couldn't be done correctly.", e);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Flowdalic done
Documentation: http://xmpp.org/extensions/inbox/isr.html
WARNING: This implementation wasn't tested against a server yet.
However, it has many unit tests checking nonzas parsers and validations.
I send this PR in order to receive feedback and refine it.
fyi @Flowdalic