disconnect / apache-websocket

Apache WebSocket module
Apache License 2.0
196 stars 46 forks source link

Fix crashes under load when using TLS #41

Open jchampio opened 9 years ago

jchampio commented 9 years ago

Occasionally, when under load from several wss:// connections, Apache will segfault. This appears to be due to mod_websocket's multithreaded use of the bucket brigade pair; note that OpenSSL may read during a write and vice-versa, which could cause multiple threads to access the same brigade simultaneously. The problem seems to be easier to reproduce on Windows (I haven't reproduced with a Linux server yet).

This pull request implements single-threaded access to the bucket brigade, with cross-thread communication being done through a queue. The entire backstory and discussion can be read on the httpd modules-dev mailing list.