Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rdp: Refactor csp_rdp_queue_flush using csp_queue_empty
With the newly introduced csp_queue_empty(), we can refactor csp_rdp_queue_flush() to improve clarity and functionality. csp_rdp_queue_flush() now consists of a simple if-else statement that calls csp_queue_empty() or __csp_rdp_queue_flush(). This change explicitly indicates that emptying both tx_queue and rx_queue without a connection is intended behavior (whether this is a good idea is a separate issue). __csp_rdp_queue_flush() traverses the items in the queue as follows: 1. Dequeue a packet. 2. Compare the packet against the given connection. 3. Free or re-enqueue the packet based on the given connection. Note that this operation is not thread-safe. However, the current CSP RDP codebase is not thread-safe, and this issue will be addressed in a future commit. Signed-off-by: Yasushi SHOJI <[email protected]>
- Loading branch information