[SERVER-60678] Add peek functionality to ASIOSession Created: 13/Oct/21  Updated: 29/Oct/23  Resolved: 05/Nov/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.2.0-rc0, 5.0.7

Type: Improvement Priority: Major - P3
Reporter: Tyler Seip (Inactive) Assignee: Tyler Seip (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-58496 Detect connections made via the Proxy... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v5.0
Sprint: Service Arch 2021-11-01, Service Arch 2021-11-15
Participants:
Story Points: 3

 Description   

ASIOSession currently only supports read and write operations. In order to properly parse the proxy protocol (see SERVER-58496) it would be helpful to be able to peek at the channel to see what bytes we've received without consuming them from the underlying buffers (in case we read past the end of the proxy protocol header in the stream). In this ticket, add a peek buffer to the ASIOSession sockets which interacts correctly with the extant read functions. Peeking should be opportunistic and never block.



 Comments   
Comment by Githook User [ 17/Mar/22 ]

Author:

{'name': 'Tyler Seip', 'email': 'Tyler.Seip@mongodb.com', 'username': 'tseip-mongo'}

Message: SERVER-60678: Add peeking to SessionASIO
Branch: LB
https://github.com/mongodb/mongo/commit/4053e44ece1ecdb6eb3329d8c5afda66ab5900e2

Comment by Githook User [ 16/Mar/22 ]

Author:

{'name': 'Tyler Seip', 'email': 'Tyler.Seip@mongodb.com', 'username': 'tseip-mongo'}

Message: SERVER-60678: Add peeking to SessionASIO
Branch: v5.0
https://github.com/mongodb/mongo/commit/a4f74872c86ce146a7079e397aa54d5f3711a4f4

Comment by Githook User [ 05/Nov/21 ]

Author:

{'name': 'Tyler Seip', 'email': 'Tyler.Seip@mongodb.com', 'username': 'tseip-mongo'}

Message: SERVER-60678: Add peeking to SessionASIO
Branch: master
https://github.com/mongodb/mongo/commit/bb1be9d4a6e8a8828709729cd344490c7f460a64

Generated at Thu Feb 08 05:50:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.