Skip to content

Commit

Permalink
CommonAPI-SomeIP 3.1.10.2
Browse files Browse the repository at this point in the history
  • Loading branch information
juergengehring committed Dec 12, 2016
1 parent ff3edbf commit 51d4c37
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Changes
=======

v3.1.10.2
- Revised handling for timeouts of asynchronous calls

v3.1.10.1
- Check subscription counter also if eventhandler was erased.
- Avoid segmentation fault when creating a connection failed.
Expand Down
1 change: 1 addition & 0 deletions include/CommonAPI/SomeIP/Connection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ class Connection:
std::shared_ptr<vsomeip::message>,
std::unique_ptr<MessageReplyAsyncHandler> > > async_answers_map_t;
mutable async_answers_map_t asyncAnswers_;
mutable async_answers_map_t asyncTimeouts_;

mutable std::mutex eventHandlerMutex_;
typedef std::map<service_id_t,
Expand Down
16 changes: 14 additions & 2 deletions src/CommonAPI/SomeIP/Connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,18 @@ void Connection::handleProxyReceive(const std::shared_ptr<vsomeip::message> &_me
}

itsHandler->onMessageReply(callStatus, Message(_message));
return;
}

// handle async call timeouts in Mainloop mode
async_answers_map_t::iterator foundTimeoutHandler = asyncTimeouts_.find(sessionId);
if(foundTimeoutHandler != asyncTimeouts_.end()) {
std::unique_ptr<MessageReplyAsyncHandler> itsHandler
= std::move(std::get<2>(foundTimeoutHandler->second));
asyncTimeouts_.erase(sessionId);
sendReceiveMutex_.unlock();

itsHandler->onMessageReply(CallStatus::REMOTE_ERROR, Message(_message));
} else {
sendReceiveMutex_.unlock();
}
Expand Down Expand Up @@ -210,11 +222,11 @@ void Connection::cleanup() {
std::shared_ptr<MsgQueueEntry> msg_queue_entry = std::make_shared<MsgQueueEntry>(
response, commDirectionType::PROXYRECEIVE);
watch_->pushQueue(msg_queue_entry);
it++;
asyncTimeouts_[it->first] = std::move(it->second);
} else {
std::get<2>(it->second)->onMessageReply(CallStatus::REMOTE_ERROR, Message(response));
it = asyncAnswers_.erase(it);
}
it = asyncAnswers_.erase(it);
} else {
it++;
}
Expand Down

0 comments on commit 51d4c37

Please sign in to comment.