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/audio/hound/audio_device.c

    r76f566d r984a9ba  
    5454static errno_t device_sink_connection_callback(audio_sink_t *sink, bool new);
    5555static errno_t device_source_connection_callback(audio_source_t *source, bool new);
    56 static void device_event_callback(cap_call_handle_t icall_handle, ipc_call_t *icall, void *arg);
     56static void device_event_callback(ipc_call_t *icall, void *arg);
    5757static errno_t device_check_format(audio_sink_t *sink);
    5858static errno_t get_buffer(audio_device_t *dev);
     
    260260/** Audio device event handler.
    261261 *
    262  * @param icall_handle  Initial call handle.
    263  * @param icall         Initial call structure.
    264  * @param arg           (unused)
    265  */
    266 static void device_event_callback(cap_call_handle_t icall_handle,
    267     ipc_call_t *icall, void *arg)
     262 * @param icall Initial call structure.
     263 * @param arg   (unused)
     264 *
     265 */
     266static void device_event_callback(ipc_call_t *icall, void *arg)
    268267{
    269268        struct timeval time1;
     
    271270
    272271        /* Answer initial request */
    273         async_answer_0(icall_handle, EOK);
     272        async_answer_0(icall, EOK);
    274273        audio_device_t *dev = arg;
    275274        assert(dev);
    276275        while (true) {
    277276                ipc_call_t call;
    278                 cap_call_handle_t chandle = async_get_call(&call);
    279                 async_answer_0(chandle, EOK);
     277                async_get_call(&call);
     278                async_answer_0(&call, EOK);
     279
    280280                switch (IPC_GET_IMETHOD(call)) {
    281281                case PCM_EVENT_FRAMES_PLAYED:
Note: See TracChangeset for help on using the changeset viewer.