Skip to content

Commit

Permalink
[dbusproxy] Set reply message when method call is successfully handled
Browse files Browse the repository at this point in the history
Method call message dispatching logic assumes that something went wrong
if handler callback does not provide reply message and sends a generic
error reply. Some handlers never fill in reply and this causes false
negative error replies to be sent to clients.

Return empty reply message even if handler does not have any specific
value to return to avoid confusion at client end.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jolla.com>
  • Loading branch information
spiiroin committed Jan 5, 2021
1 parent a3efbc2 commit 24832d3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/dbusproxy.c
Expand Up @@ -101,6 +101,7 @@ static void req_powerup(const DsmeDbusMessage* request, DsmeDbusMessage** reply)

DSM_MSGTYPE_POWERUP_REQ req = DSME_MSG_INIT(DSM_MSGTYPE_POWERUP_REQ);
modules_broadcast_internally(&req);
*reply = dsme_dbus_reply_new(request);
}

static void req_reboot(const DsmeDbusMessage* request, DsmeDbusMessage** reply)
Expand All @@ -113,6 +114,7 @@ static void req_reboot(const DsmeDbusMessage* request, DsmeDbusMessage** reply)

DSM_MSGTYPE_REBOOT_REQ req = DSME_MSG_INIT(DSM_MSGTYPE_REBOOT_REQ);
modules_broadcast_internally(&req);
*reply = dsme_dbus_reply_new(request);
}

static void req_shutdown(const DsmeDbusMessage* request,
Expand All @@ -127,6 +129,7 @@ static void req_shutdown(const DsmeDbusMessage* request,
DSM_MSGTYPE_SHUTDOWN_REQ req = DSME_MSG_INIT(DSM_MSGTYPE_SHUTDOWN_REQ);

modules_broadcast_internally(&req);
*reply = dsme_dbus_reply_new(request);
}

/** Flag for: dbus broadcast info has been installed */
Expand Down

0 comments on commit 24832d3

Please sign in to comment.