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

[FIXED] Locking in processPermissionsViolation() and added test #289

Merged
merged 1 commit into from
May 12, 2017

Conversation

kozlovic
Copy link
Member

Connection locking was missing in processPermissionsViolation().
Added a test that verifies that async cb error is invoked on
invalid publish or subscribe, and that the connection is not
closed neither by the server nor client.

@derekcollison Opening this for discussion: was it the proper intent for the server to keep the client connection (not closing it at the moment)? If so, then it makes sense for the client also to not close it and treat this as a non fatal error. This PR then simply fixes the locking and add a test (coverage was non existent for this function).

Connection locking was missing in processPermissionsViolation().
Added a test that verifies that async cb error is invoked on
invalid publish or subscribe, and that the connection is not
closed neither by the server nor client.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 95.368% when pulling faf598f on fix_permission_violation_handling into 5de724c on master.

@derekcollison
Copy link
Member

I think the client can not assume an error is fatal and should wait for the socket to be closed to clean up.

@kozlovic
Copy link
Member Author

@derekcollison Ok, so for this error, the client is not closing the connection. For stale connection, it reconnects, for all others it closes. If this needs to be changed, it should be in separate PR. Right now, this one seems to be doing the right thing then.

@derekcollison derekcollison merged commit 54db162 into master May 12, 2017
@derekcollison derekcollison deleted the fix_permission_violation_handling branch May 12, 2017 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants