-
Notifications
You must be signed in to change notification settings - Fork 288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSL-related bug with websocket send call and multithreading #174
Comments
Yeah, I'm on linux and didn't have much trouble testing this. It shows up only on SSL for me and goes away if I wrap part of send in a lock. I have a branch on my fork here: But I don't know quite enough about ws4py to be sure there's not other problems here. |
Ok yes, this makes sense. I was trying to fiddle with the SSL_WANT_WRITE flag but didn't quite figure out how to integrate it cleanly at that point. |
Not sure if I was experiencing the same problem, but locking didn't help in my case. For me the problem seemed to be that after the SSL_WANT_WRITE error, no retry was done. This seems to be a bug in I just replaced |
The solution above still has a problem when sending large messages (>16KB). Replacing the _write method in websocket with the following seems to work.
|
hello everyone,
I bumped into a problem with the
send
method ofws4py.websocket.WebSocket
when SSL is enabled.I have a CherryPy server to which I associate some WebSocket servers. Messages are sent from a few independent threads through the same socket. This works fine without SSL.
However, with SSL enabled and more than one thread per socket, some messages end up being packed together and this makes the socket terminate.
If I open separate sockets for each thread, this works fine though.
I suspect there's something similar in essence as with this bug, i.e. difference on how SSL and non-SSL sockets treat pending data (correct me if I didn't get it right).
Any clues on why this may happen and how to fix it?
EDIT: I should add that I'm on OSX, didn't try on another system yet.
EDIT2: forgot also - CherryPy 3.8.0, ws4py 0.3.4, python 2.7.10 or 3.4.3
The text was updated successfully, but these errors were encountered: