Open ajvpot opened 11 years ago
It might be possible to use the SocketServer Python Module to fix this fairly easily.
Ahh, this is why there is this random down time.
You should move to an async lib like gevent or Twisted if you feel serious about it. Whilst those are reasonably larger dependencies, they'd make it fucking easy as shit to run.
@plausibility - agreed, we need something more "robust". My commit was just meant to be a quick fix.
@JosephRedfern: It wouldn't be a small update, you'd probably be rewriting a significant amount of core code - the only bit which would stay reasonably similar would be how your commands are dispatched to classes. @Max00355 is the guy to ask for all things rewrite-y.
@plausibility - I was suggesting that https://github.com/bloocoin/bloocoin-server/issues/12 is a quick fix, with your suggestion of gevent/Twisted being something more long-term.
Definitely worth looking into, since as demonstrated, a non-closed socket can hang the entire operation.
The current socket listen loop doesn't send the data off to a thread until it receives data. If you open a socket to the Bloocoin server and don't send any data, it blocks the main thread indefinitely. This creates a very simple DoS vulnerability.