Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c9d44b84 authored by Elliott Hughes's avatar Elliott Hughes
Browse files

Don't reject "ctl.stop.*" during shutdown.

We're shutting down anyway, so the service is either dead already
or about to be killed, and callers get upset (and don't have a good
response themselves) if we reject the request.

This was seen by a partner where adbd was asked to stop during
shutdown.

Bug: https://issuetracker.google.com/336223505
Change-Id: If09feeef2e0f2d1be9ff84a88cca6ed593a35362
parent 8240c53e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -453,6 +453,10 @@ static uint32_t SendControlMessage(const std::string& msg, const std::string& na
                                   SocketConnection* socket, std::string* error) {
    auto lock = std::lock_guard{accept_messages_lock};
    if (!accept_messages) {
        // If we're already shutting down and you're asking us to stop something,
        // just say we did (https://issuetracker.google.com/336223505).
        if (msg == "stop") return PROP_SUCCESS;

        *error = "Received control message after shutdown, ignoring";
        return PROP_ERROR_HANDLE_CONTROL_MESSAGE;
    }