Changeset 984a9ba in mainline for uspace/srv/hid/input/input.c


Ignore:
Timestamp:
2018-07-05T09:34:09Z (6 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
63d46341
Parents:
76f566d
Message:

do not expose the call capability handler from the async framework

Keep the call capability handler encapsulated within the async framework
and do not expose it explicitly via its API. Use the pointer to
ipc_call_t as the sole object identifying an IPC call in the code that
uses the async framework.

This plugs a major leak in the abstraction and also simplifies both the
async framework (slightly) and all IPC servers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/input/input.c

    r76f566d r984a9ba  
    320320
    321321/** New client connection */
    322 static void client_connection(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
     322static void client_connection(ipc_call_t *icall, void *arg)
    323323{
    324324        client_t *client = (client_t *) async_get_client_data();
    325325        if (client == NULL) {
    326                 async_answer_0(icall_handle, ENOMEM);
     326                async_answer_0(icall, ENOMEM);
    327327                return;
    328328        }
    329329
    330         async_answer_0(icall_handle, EOK);
     330        async_answer_0(icall, EOK);
    331331
    332332        while (true) {
    333333                ipc_call_t call;
    334                 cap_call_handle_t chandle = async_get_call(&call);
     334                async_get_call(&call);
    335335
    336336                if (!IPC_GET_IMETHOD(call)) {
     
    340340                        }
    341341
    342                         async_answer_0(chandle, EOK);
     342                        async_answer_0(&call, EOK);
    343343                        return;
    344344                }
     
    349349                        if (client->sess == NULL) {
    350350                                client->sess = sess;
    351                                 async_answer_0(chandle, EOK);
     351                                async_answer_0(&call, EOK);
    352352                        } else
    353                                 async_answer_0(chandle, ELIMIT);
     353                                async_answer_0(&call, ELIMIT);
    354354                } else {
    355355                        switch (IPC_GET_IMETHOD(call)) {
     
    357357                                active_client = client;
    358358                                client_arbitration();
    359                                 async_answer_0(chandle, EOK);
     359                                async_answer_0(&call, EOK);
    360360                                break;
    361361                        default:
    362                                 async_answer_0(chandle, EINVAL);
     362                                async_answer_0(&call, EINVAL);
    363363                        }
    364364                }
Note: See TracChangeset for help on using the changeset viewer.