Changeset 6d74977 in mainline


Ignore:
Timestamp:
2013-04-05T15:38:16Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
02ead2e
Parents:
1f440f5f
Message:

libhound: fix data transfer answers

finalize answers EOK for us so postpone real answer until next request

File:
1 edited

Legend:

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

    r1f440f5f r6d74977  
    486486        ipc_call_t call;
    487487        size_t size = 0;
     488        int ret_answer = EOK;
    488489        while (async_data_write_receive_call(&callid, &call, &size)
    489490            || (IPC_GET_IMETHOD(call) == IPC_M_HOUND_STREAM_DRAIN)) {
     
    495496                        continue;
    496497                }
     498                if (ret_answer != EOK) {
     499                        async_answer_0(callid, ret_answer);
     500                        continue;
     501                }
    497502                char *buffer = malloc(size);
    498503                if (!buffer) {
     
    500505                        continue;
    501506                }
    502                 int ret = async_data_write_finalize(callid, buffer, size);
     507                const int ret = async_data_write_finalize(callid, buffer, size);
    503508                if (ret == EOK) {
    504                         ret = server_iface->stream_data_write(
     509                        ret_answer = server_iface->stream_data_write(
    505510                            stream, buffer, size);
    506511                }
    507                 async_answer_0(callid, ret);
    508512        }
    509513        const int ret = IPC_GET_IMETHOD(call) == IPC_M_HOUND_STREAM_EXIT
     
    519523        ipc_call_t call;
    520524        size_t size = 0;
     525        int ret_answer = EOK;
    521526        while (async_data_read_receive_call(&callid, &call, &size)
    522527            || (IPC_GET_IMETHOD(call) == IPC_M_HOUND_STREAM_DRAIN)) {
     
    528533                        continue;
    529534                }
     535                if (ret_answer != EOK) {
     536                        async_answer_0(callid, ret_answer);
     537                        continue;
     538                }
    530539                char *buffer = malloc(size);
    531540                if (!buffer) {
     
    535544                int ret = server_iface->stream_data_read(stream, buffer, size);
    536545                if (ret == EOK) {
    537                         ret = async_data_read_finalize(callid, buffer, size);
    538                 }
    539                 async_answer_0(callid, ret);
     546                        ret_answer =
     547                            async_data_read_finalize(callid, buffer, size);
     548                }
    540549        }
    541550        const int ret = IPC_GET_IMETHOD(call) == IPC_M_HOUND_STREAM_EXIT
Note: See TracChangeset for help on using the changeset viewer.