shokai / websocket-client-simple

Simple WebSocket Client on Ruby
https://rubygems.org/gems/websocket-client-simple
MIT License
115 stars 68 forks source link

Avoid triggering a segfault due to a read/close race #25

Open matthewd opened 8 years ago

matthewd commented 8 years ago

A well-timed pair of threads can trigger a segfault if they call close and read on the same IO at the same time.

It's easy to avoid that with a tiny rearrangement: we can just make sure we shut down the read thread before we close the socket.

No new test, because it's not that easy to trigger on demand.

unasuke commented 2 years ago

@matthewd This repository was moved ruby-jp/websocket-client-simple. If you still need this, make pull request or issue to ruby-jp/websocket-client-simple again, thx.