Changeset 984a9ba in mainline for uspace/lib/c/generic/inet/udp.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/lib/c/generic/inet/udp.c

    r76f566d r984a9ba  
    4141#include <stdlib.h>
    4242
    43 static void udp_cb_conn(cap_call_handle_t, ipc_call_t *, void *);
     43static void udp_cb_conn(ipc_call_t *, void *);
    4444
    4545/** Create callback connection from UDP service.
     
    451451 * callback and discard it.
    452452 *
    453  * @param udp UDP client
    454  * @param iid IPC message ID
     453 * @param udp   UDP client
    455454 * @param icall IPC message
    456  */
    457 static void udp_ev_data(udp_t *udp, cap_call_handle_t icall_handle, ipc_call_t *icall)
     455 *
     456 */
     457static void udp_ev_data(udp_t *udp, ipc_call_t *icall)
    458458{
    459459        udp_rmsg_t rmsg;
     
    481481        }
    482482
    483         async_answer_0(icall_handle, EOK);
     483        async_answer_0(icall, EOK);
    484484}
    485485
    486486/** UDP service callback connection.
    487487 *
    488  * @param iid Connect message ID
    489488 * @param icall Connect message
    490  * @param arg Argument, UDP client
    491  */
    492 static void udp_cb_conn(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg)
     489 * @param arg   Argument, UDP client
     490 *
     491 */
     492static void udp_cb_conn(ipc_call_t *icall, void *arg)
    493493{
    494494        udp_t *udp = (udp_t *)arg;
    495495
    496         async_answer_0(icall_handle, EOK);
     496        async_answer_0(icall, EOK);
    497497
    498498        while (true) {
    499499                ipc_call_t call;
    500                 cap_call_handle_t chandle = async_get_call(&call);
     500                async_get_call(&call);
    501501
    502502                if (!IPC_GET_IMETHOD(call)) {
     
    507507                switch (IPC_GET_IMETHOD(call)) {
    508508                case UDP_EV_DATA:
    509                         udp_ev_data(udp, chandle, &call);
     509                        udp_ev_data(udp, &call);
    510510                        break;
    511511                default:
    512                         async_answer_0(chandle, ENOTSUP);
     512                        async_answer_0(&call, ENOTSUP);
    513513                        break;
    514514                }
    515515        }
     516
    516517out:
    517518        fibril_mutex_lock(&udp->lock);
Note: See TracChangeset for help on using the changeset viewer.