Changeset 984a9ba in mainline for uspace/srv/ns/service.c


Ignore:
Timestamp:
2018-07-05T09:34:09Z (7 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/ns/service.c

    r76f566d r984a9ba  
    8989        service_t service;         /**< Service ID */
    9090        iface_t iface;             /**< Interface ID */
    91         cap_call_handle_t chandle; /**< Call handle waiting for the connection */
    92         sysarg_t arg3;             /**< Third argument */
     91        ipc_call_t call;           /**< Call waiting for the connection */
    9392} pending_conn_t;
    9493
     
    119118                hashed_service_t *hashed_service = hash_table_get_inst(link, hashed_service_t, link);
    120119                async_exch_t *exch = async_exchange_begin(hashed_service->sess);
    121                 async_forward_fast(pending->chandle, exch, pending->iface,
    122                     pending->arg3, 0, IPC_FF_NONE);
     120                async_forward_fast(&pending->call, exch, pending->iface,
     121                    IPC_GET_ARG3(pending->call), 0, IPC_FF_NONE);
    123122                async_exchange_end(exch);
    124123
     
    163162 * @param iface    Interface to be connected to.
    164163 * @param call     Pointer to call structure.
    165  * @param chandle  Call handle of the request.
    166164 *
    167165 * @return Zero on success or a value from @ref errno.h.
    168166 *
    169167 */
    170 void connect_to_service(service_t service, iface_t iface, ipc_call_t *call,
    171     cap_call_handle_t chandle)
    172 {
    173         sysarg_t arg3 = IPC_GET_ARG3(*call);
     168void connect_to_service(service_t service, iface_t iface, ipc_call_t *call)
     169{
    174170        sysarg_t flags = IPC_GET_ARG4(*call);
    175171        errno_t retval;
     
    189185                        pending->service = service;
    190186                        pending->iface = iface;
    191                         pending->chandle = chandle;
    192                         pending->arg3 = arg3;
     187                        pending->call = *call;
    193188
    194189                        list_append(&pending->link, &pending_conn);
     
    202197        hashed_service_t *hashed_service = hash_table_get_inst(link, hashed_service_t, link);
    203198        async_exch_t *exch = async_exchange_begin(hashed_service->sess);
    204         async_forward_fast(chandle, exch, iface, arg3, 0, IPC_FF_NONE);
     199        async_forward_fast(call, exch, iface, IPC_GET_ARG3(*call), 0, IPC_FF_NONE);
    205200        async_exchange_end(exch);
    206201        return;
    207202
    208203out:
    209         async_answer_0(chandle, retval);
     204        async_answer_0(call, retval);
    210205}
    211206
Note: See TracChangeset for help on using the changeset viewer.