You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a given server (asio transport) with permessage_deflate turned on it eventually (quickly) sends corrupted messages. I believe this is due to the fact that I'm "send()"ing messages on threads other than my server's io_service thread.
At first glance in extensions/permessage_deflate/enabled.hpp I see the buffer is used for both compress and decompress:
size_t m_compress_buffer_size;
lib::unique_ptr_uchar_array m_compress_buffer;
But when I attach a debugger I'm not finding any locks in my backtrace that would prevent a compress() and decompress() from occurring at the same time. (on different threads)
Moving all send() calls to the main io_service thread corrects the issue for me.
I thought I read that it should be okay to send() outside of the io_service thread. Am I missing somthing?
The text was updated successfully, but these errors were encountered:
I think we have this issue as well. The websockets are closed at random times, with code 1006 or 1007 and reason, Could not decode a text frame as UTF-8 or Invalid frame header.
If we disable the deflate setting, then the connection is kept open but if we enable it we see a close event after 5~60 minutes.
Our application is multi-threaded where all relevant threads execute io_service.run().
It definitely should be safe to call send on separate threads than the main I/O thread. The situation with the compress buffer definitely violates this. I've applied an update very similar to one @pdgendt posted in #633 to the develop branch that should fix this.
For a given server (asio transport) with permessage_deflate turned on it eventually (quickly) sends corrupted messages. I believe this is due to the fact that I'm "send()"ing messages on threads other than my server's io_service thread.
At first glance in extensions/permessage_deflate/enabled.hpp I see the buffer is used for both compress and decompress:
size_t m_compress_buffer_size;
lib::unique_ptr_uchar_array m_compress_buffer;
But when I attach a debugger I'm not finding any locks in my backtrace that would prevent a compress() and decompress() from occurring at the same time. (on different threads)
Moving all send() calls to the main io_service thread corrects the issue for me.
I thought I read that it should be okay to send() outside of the io_service thread. Am I missing somthing?
The text was updated successfully, but these errors were encountered: