summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Kutsan <akutsan@luxoft.com>2017-06-23 12:10:45 +0300
committerAlex Kutsan <akutsan@luxoft.com>2017-06-23 12:10:45 +0300
commitbff6e483eb80a0563159d825dd7ba636815c402d (patch)
tree21454073e446f239a37b4977907c3d059dae8847
parentc1669c0d89363a1b973cc21d15c4e181ec3d62b1 (diff)
downloadsdl_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.h2
-rw-r--r--src/components/protocol_handler/src/protocol_handler_impl.cc11
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,