Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug Fix: Race condition between ws_accept() and function return
In PR #82, the signature of the ws_socket() function was modified to receive a 'ws_server' structure as a parameter. However, the content of this structure was only copied later when the thread for performing accepts() was created. This could lead to a situation where, if the 'ws_server' structure was allocated on the stack, a potential function return (prior to thread execution) would render the address invalid, effectively creating a race condition between thread creation and function return. The fix is straightforward: simply have the 'ws_accept_params' structure store the 'ws_server' structure itself instead of a pointer to it. This should address issue #86.
- Loading branch information