Skip to content

Commit

Permalink
fix freezing service calls when returning false (fix #168)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas committed Feb 15, 2013
1 parent 9cd2b75 commit 9fc330e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions clients/cpp/roscpp/src/libros/service_publication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class ServiceCallback : public CallbackInterface

if (!tracker)
{
SerializedMessage res = serialization::serializeServiceResponse(false, 0);
SerializedMessage res = serialization::serializeServiceResponse<uint32_t>(false, 0);
link_->processResponse(false, res);
return Invalid;
}
Expand All @@ -123,7 +123,15 @@ class ServiceCallback : public CallbackInterface
{

bool ok = helper_->call(params);
link_->processResponse(ok, params.response);
if (ok != 0)
{
link_->processResponse(true, params.response);
}
else
{
SerializedMessage res = serialization::serializeServiceResponse<uint32_t>(false, 0);
link_->processResponse(false, res);
}
}
catch (std::exception& e)
{
Expand Down

0 comments on commit 9fc330e

Please sign in to comment.