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

On Session Ended, hashID should be sent for RPC Service. #346

Closed
wants to merge 7 commits into from
Closed

On Session Ended, hashID should be sent for RPC Service. #346

wants to merge 7 commits into from

Conversation

asm09fsu
Copy link
Contributor

@asm09fsu asm09fsu commented Feb 3, 2016

Fixes #345

@joeljfischer joeljfischer added the bug A defect in the library label Feb 4, 2016
@joeljfischer joeljfischer added this to the 4.0.X milestone Feb 4, 2016
@@ -28,6 +28,7 @@ @interface SDLProtocol () {
dispatch_queue_t _sendQueue;
SDLPrioritizedObjectCollection *_prioritizedCollection;
NSMutableDictionary *_sessionIDs;
NSMutableDictionary *_hashIDs;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think that instead of storing multiple dictionaries with sessionIDs / hashIDs / whatever else in the future, it should just be one dict with various metadata about the service? That's what I'm starting to lean towards.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would probably be a good idea for a future enhancement. We would need to make sure it's dynamic enough to accept any future metadata. Would this be suitable for now, do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either dynamic enough or private enough to change it without consequence. Probably the latter.

I'm considering the change in this security branch to track which services are encrypted, so that if you try to send an encrypted RPC on a non-encrypted service type it fails, I think this would fit in the same place. So I would say yeah, it probably fine for now, but should change sooner rather than later. Maybe as a "hotfix" separate from this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, technically it should be hashIds, since "Id" is short for one word, not two. Not sure how we want to handle that since it's already done incorrectly with sessionIDs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tried to best following existing naming so when we do changes it'll be consistent ;)

@@ -310,7 +345,7 @@ - (void)sendRawData:(NSData *)data withServiceType:(SDLServiceType)serviceType {


#pragma mark - SDLProtocolListener Implementation
- (void)handleProtocolStartSessionACK:(SDLServiceType)serviceType sessionID:(Byte)sessionID version:(Byte)version {
- (void)handleProtocolStartSessionACK:(SDLServiceType)serviceType sessionID:(Byte)sessionID hashID:(UInt32)hashID version:(Byte)version {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, we're both touching the same code here. The security framework deprecates and updates most of these SDLProtocolListener calls. This one that you're changing would have necessitated a major version change (so that you are aware in the future). The security framework adds a method that passes the entire SessionACK header, that might require some changes to this on your part.

@asm09fsu
Copy link
Contributor Author

@joeljfischer how's this latest commit?

@joeljfischer joeljfischer modified the milestones: 4.X, 4.0.X Feb 26, 2016
@@ -9,7 +9,8 @@
@protocol SDLProtocolListener <NSObject>

@optional
- (void)handleProtocolStartSessionACK:(SDLServiceType)serviceType sessionID:(Byte)sessionID version:(Byte)version;
- (void)handleProtocolStartSessionACK:(SDLServiceType)serviceType sessionID:(Byte)sessionID version:(Byte)version __deprecated_msg("use -handleProtocolStartSessionACK:sessionID:hashID:version: instead");
- (void)handleProtocolStartSessionACK:(SDLServiceType)serviceType sessionID:(Byte)sessionID hashID:(UInt32)hashID version:(Byte)version;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still not happy with this because security PR is creating a different method, so in the security PR I'd have to deprecate this method. It would be better to have it follow the security framework's changes to this protocol instead.

In any case, thanks for the merge nightmare 😰

@joeljfischer
Copy link
Contributor

This was fixed in 4.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A defect in the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants