Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 71780e0 in mainline


Ignore:
Timestamp:
2013-03-23T13:12:07Z (9 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
a4165561
Parents:
5ae1c51
Message:

libhound: Use call data preserving handler to recognize the exit command.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/hound/src/protocol.c

    r5ae1c51 r71780e0  
    225225
    226226        ipc_callid_t callid;
     227        ipc_call_t call;
    227228        size_t size = 0;
    228         while (async_data_write_receive(&callid, &size)) {
     229        while (async_data_write_receive_call(&callid, &call, &size)) {
    229230                char *buffer = malloc(size);
    230231                if (!buffer) {
     
    236237                        server_iface->stream_data_write(stream, buffer, size);
    237238                } else {
    238                         // TODO did answering fail?
    239239                        async_answer_0(callid, ret);
    240240                }
    241241        }
    242         //TODO we assume that the fail was caused by IPC_M_HOUND_STREAM_EXIT
    243         async_answer_0(callid, EOK);
    244         return EOK;
     242        //TODO drain?
     243        const int ret = IPC_GET_IMETHOD(call) == IPC_M_HOUND_STREAM_EXIT
     244            ? EOK : EINVAL;
     245
     246        async_answer_0(callid, ret);
     247        return ret;
    245248}
    246249
Note: See TracChangeset for help on using the changeset viewer.