diff options
author | Thomas White <taw@physics.org> | 2022-07-06 15:28:38 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2022-07-06 16:15:05 +0200 |
commit | 5e06310da1d04436a27354f3d305a520ce993c1d (patch) | |
tree | 6d2fc2d6e22b94a68c8bab5ad352063686997ee1 /src/im-sandbox.c | |
parent | e1bee0847d0843ca028106dc8940df72e8690eb1 (diff) |
indexamajig: Add timeout for ZMQ socket
Diffstat (limited to 'src/im-sandbox.c')
-rw-r--r-- | src/im-sandbox.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/im-sandbox.c b/src/im-sandbox.c index 5c4629ce..a9722509 100644 --- a/src/im-sandbox.c +++ b/src/im-sandbox.c @@ -452,14 +452,13 @@ static int run_work(const struct index_args *iargs, Stream *st, profile_start("zmq-fetch"); set_last_task(sb->shared->last_task[cookie], "ZMQ fetch"); - do { - pargs.zmq_data = im_zmq_fetch(zmqstuff, - &pargs.zmq_data_size); - } while ( pargs.zmq_data_size < 15 ); - ok = 1; - + pargs.zmq_data = im_zmq_fetch(zmqstuff, + &pargs.zmq_data_size); profile_end("zmq-fetch"); + if ( (pargs.zmq_data != NULL) + && (pargs.zmq_data_size > 15) ) ok = 1; + /* The filename/event, which will be 'fake' values in * this case, still came via the event queue. More * importantly, the event queue gave us a unique |