diff options
author | Sho Amano <samano@xevo.com> | 2017-08-10 18:31:05 +0900 |
---|---|---|
committer | Sho Amano <samano@xevo.com> | 2017-08-11 10:44:34 +0900 |
commit | 65f356c44d339aa860a52cee1dff35a37047f35d (patch) | |
tree | fa8be9bd085fad18e9a8554c2bb7f33ccd6f2f24 /src/components/protocol_handler/include/protocol_handler | |
parent | fcf4563ce4f0494777be7fe66b43a7b8808efd2f (diff) | |
download | sdl_core-65f356c44d339aa860a52cee1dff35a37047f35d.tar.gz |
fix: session ID and hash ID may be notified to wrong proxy
This commit includes following changes:
- Add connection_id and session_id args in
ProtocolHandler::NotifySessionStartedResult()
- Use pair of connection_id and session_id to remember the
request packet until NotifySessionStartedResult() is called
Reflecting review comments.
Diffstat (limited to 'src/components/protocol_handler/include/protocol_handler')
-rw-r--r-- | src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h | 18 |
1 files changed, 12 insertions, 6 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 ad70dfc62b..c312d34aed 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 @@ -84,6 +84,8 @@ class MessagesToMobileAppHandler; using transport_manager::TransportManagerListenerEmpty; typedef std::multimap<int32_t, RawMessagePtr> MessagesOverNaviMap; +typedef std::map<std::pair<ConnectionID, uint8_t>, ProtocolFramePtr> + StartSessionFrameMap; typedef std::set<ProtocolObserver*> ProtocolObservers; typedef transport_manager::ConnectionUID ConnectionID; @@ -352,16 +354,20 @@ class ProtocolHandlerImpl /** * \brief Called by connection handler to notify the result of * OnSessionStartedCallback(). - * \param session_id Generated session ID, will be 0 if session is not - * started + * \param connection_id Identifier of connection within which session exists + * \param session_id session ID passed to OnSessionStartedCallback() + * \param generated_session_id Generated session ID, will be 0 if session is + * not started * \param hash_id Generated Hash ID * \param protection whether the service will be protected * \param rejected_params list of parameters' name that are rejected. - * Only valid when session_id is 0. Note, even if session_id is 0, the - * list may be empty. + * Only valid when generated_session_id is 0. Note, even if + * generated_session_id is 0, the list may be empty. */ void NotifySessionStartedResult( + int32_t connection_id, uint8_t session_id, + uint8_t generated_session_id, uint32_t hash_id, bool protection, std::vector<std::string>& rejected_params) OVERRIDE; @@ -638,8 +644,8 @@ class ProtocolHandlerImpl sync_primitives::Lock protocol_observers_lock_; - // we need thread-safe queue - utils::MessageQueue<ProtocolFramePtr> start_session_frame_queue_; + sync_primitives::Lock start_session_frame_map_lock_; + StartSessionFrameMap start_session_frame_map_; #ifdef TELEMETRY_MONITOR PHTelemetryObserver* metric_observer_; |