Changeset 984a9ba in mainline for uspace/srv/logger/writer.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/logger/writer.c

    r76f566d r984a9ba  
    9494}
    9595
    96 void logger_connection_handler_writer(cap_call_handle_t chandle)
     96void logger_connection_handler_writer(ipc_call_t *icall)
    9797{
    9898        logger_log_t *log;
     
    100100
    101101        /* Acknowledge the connection. */
    102         async_answer_0(chandle, EOK);
     102        async_answer_0(icall, EOK);
    103103
    104104        logger_log("writer: new client.\n");
     
    109109        while (true) {
    110110                ipc_call_t call;
    111                 cap_call_handle_t chandle = async_get_call(&call);
     111                async_get_call(&call);
    112112
    113113                if (!IPC_GET_IMETHOD(call))
     
    118118                        log = handle_create_log(IPC_GET_ARG1(call));
    119119                        if (log == NULL) {
    120                                 async_answer_0(chandle, ENOMEM);
     120                                async_answer_0(&call, ENOMEM);
    121121                                break;
    122122                        }
    123123                        if (!register_log(&registered_logs, log)) {
    124124                                log_unlock(log);
    125                                 async_answer_0(chandle, ELIMIT);
     125                                async_answer_0(&call, ELIMIT);
    126126                                break;
    127127                        }
    128128                        log_unlock(log);
    129                         async_answer_1(chandle, EOK, (sysarg_t) log);
     129                        async_answer_1(&call, EOK, (sysarg_t) log);
    130130                        break;
    131131                case LOGGER_WRITER_MESSAGE:
    132132                        rc = handle_receive_message(IPC_GET_ARG1(call),
    133133                            IPC_GET_ARG2(call));
    134                         async_answer_0(chandle, rc);
     134                        async_answer_0(&call, rc);
    135135                        break;
    136136                default:
    137                         async_answer_0(chandle, EINVAL);
     137                        async_answer_0(&call, EINVAL);
    138138                        break;
    139139                }
     
    144144}
    145145
    146 
    147146/**
    148147 * @}
Note: See TracChangeset for help on using the changeset viewer.