Re: [devel] [PATCH 1/1] amfd: prevent infinite loop [#3050]

2019-06-20 Thread Hans Nordebäck
Hi Gary, ack, code review only/Thanks HansN On 2019-06-20 04:13, Gary Lee wrote: > In handle_event_in_failover_state(), we iterate through > queue_evt in a while loop, but process_event() can insert > items into the queue inside the loop, and we may end > up never exiting the while loop. > --- >

[devel] [PATCH 1/1] amfd: prevent infinite loop [#3050]

2019-06-19 Thread Gary Lee
In handle_event_in_failover_state(), we iterate through queue_evt in a while loop, but process_event() can insert items into the queue inside the loop, and we may end up never exiting the while loop. --- src/amf/amfd/main.cc | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --

Re: [devel] [PATCH 1/1] amfd: prevent infinite loop [#3050]

2019-06-19 Thread Gary Lee
Hi I think I have to re-work this. 23.3.3.4 of the C++11 standard says: Effects: An erase operation that erases the last element of a deque invalidates only the past-the-end iterator and all iterators and references to the erased elements. So I've probably done the wrong thing here. On 19/

[devel] [PATCH 1/1] amfd: prevent infinite loop [#3050]

2019-06-18 Thread Gary Lee
In handle_event_in_failover_state(), we iterate through queue_evt in a while loop, but process_event() can insert items into the queue inside the loop, and we may end up never exiting the while loop. --- src/amf/amfd/cb.h | 3 ++- src/amf/amfd/main.cc | 13 + src/amf/amfd/ndfsm