Skip to content

Commit

Permalink
create DUP signal and pass it through to the async process function
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Aug 24, 2017
1 parent 772072e commit 26724e9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/lib/io/io.h
Expand Up @@ -42,6 +42,7 @@ typedef struct fr_listen fr_listen_t;
*/
typedef enum fr_io_action_t {
FR_IO_ACTION_RUN,
FR_IO_ACTION_DUP,
FR_IO_ACTION_DONE,
} fr_io_action_t;

Expand Down
15 changes: 13 additions & 2 deletions src/lib/io/worker.c
Expand Up @@ -887,12 +887,23 @@ static REQUEST *fr_worker_get_request(fr_worker_t *worker, fr_time_t now)
*
* @todo - fix the channel code to do queue
* depth, and not sequence / ack.
*
* @todo - send DUP signal to old request!
*/
if (old->async->recv_time == request->async->recv_time) {
fr_channel_null_reply(request->async->channel);
talloc_free(request);

/*
* Signal there's a dup, and ignore the
* return code. We don't bother replying
* here, as an FD event or timer will
* wake up the request, and cause it to
* continue.
*
* @todo - the old request is NOT
* running, but is yielded. It MAY clean
* itself up, or do something...
*/
(void) old->async->process(old, FR_IO_ACTION_DUP);
return NULL;
}

Expand Down

0 comments on commit 26724e9

Please sign in to comment.