[SERVER-34636] enable session_asio opportunistic writes with ssl Created: 24/Apr/18 Updated: 29/Oct/23 Resolved: 26/Apr/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Networking |
| Affects Version/s: | None |
| Fix Version/s: | 4.0.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Mira Carey | Assignee: | Mira Carey |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Operating System: | ALL |
| Sprint: | Platforms 2018-05-07 |
| Participants: |
| Description |
|
We disabled opportunistic write for TLS in session_asio when we dropped the implementation in because it didn't work. specifically, we're talking about setting the socket to non-blocking, then doing a write which would block in the tcp send. The core of the problem was that asio had no way of forcing the rest of the low level send, because it only had an opportunity to do work when asked to do a write (which worked or not for it's own reasons, generally the size of the openssl buffer being used for encryption). The fix is to expose the unsent buffer in the event of socket failure, and finish the work ourselves with direct calls to write the underlying buffer. |
| Comments |
| Comment by Githook User [ 26/Apr/18 ] |
|
Author: {'email': 'jcarey@argv.me', 'username': 'hanumantmk', 'name': 'Jason Carey'}Message: Add a side channel to the asio ssl streams which allows us to capture This makes opportunistic writes safe for ssl sockets |