diff options
author | Alex Kutsan <akutsan@luxoft.com> | 2017-06-23 12:10:45 +0300 |
---|---|---|
committer | Alex Kutsan <akutsan@luxoft.com> | 2017-06-23 12:10:45 +0300 |
commit | bff6e483eb80a0563159d825dd7ba636815c402d (patch) | |
tree | 21454073e446f239a37b4977907c3d059dae8847 | |
parent | c1669c0d89363a1b973cc21d15c4e181ec3d62b1 (diff) | |
download | sdl_core-bff6e483eb80a0563159d825dd7ba636815c402d.tar.gz |
fixup! Fix incorrect behaviour of SDL during respose ACK whenr video and audio services starts
-rw-r--r-- | src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h | 2 | ||||
-rw-r--r-- | src/components/protocol_handler/src/protocol_handler_impl.cc | 11 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h index b18ee07d4d..ce37148451 100644 --- a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h +++ b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h @@ -245,7 +245,7 @@ class ProtocolHandlerImpl */ void SendStartSessionAck(ConnectionID connection_id, uint8_t session_id, - uint8_t protocol_version, + uint8_t input_protocol_version, uint32_t hash_code, uint8_t service_type, bool protection); diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index 33df7a21c7..039399b46d 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -176,20 +176,23 @@ void set_hash_id(uint32_t hash_id, protocol_handler::ProtocolPacket& packet) { void ProtocolHandlerImpl::SendStartSessionAck(ConnectionID connection_id, uint8_t session_id, - uint8_t protocol_version, + uint8_t input_protocol_version, uint32_t hash_id, uint8_t service_type, bool protection) { LOG4CXX_AUTO_TRACE(logger_); - uint8_t protocolVersion = SupportedSDLProtocolVersion(); + uint8_t ack_protocol_version = SupportedSDLProtocolVersion(); if (kRpc != service_type) { - protocolVersion = protocol_version; + // In case if input protocol version os bigger then supported, SDL should respond with maximum supported protocol version + ack_protocol_version = input_protocol_version < ack_protocol_version + ? input_protocol_version + : ack_protocol_version; } ProtocolFramePtr ptr( new protocol_handler::ProtocolPacket(connection_id, - protocolVersion, + ack_protocol_version, protection, FRAME_TYPE_CONTROL, service_type, |