Uh oh!
There was an error while loading. Please reload this page.
process more TLS frames at one when available - #50815
Conversation
ghost
commented
Apr 6, 2021
Tagging subscribers to this area: @dotnet/ncl, @vcsjones Issue DetailsThis is fragment of original #49743 AuxRecord tests are removed as they depend on particular read side. fixes #49000
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
davidfowl
commented
Apr 23, 2021
Preview5? |
wfurt
commented
Apr 30, 2021
I did another pass towards direction we discussed @geoffkizer. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| // _internalOffset is 0 after ResetReadBuffer and we use _internalBufferCount to determined where to read. | ||
| while (_internalBufferCount < frameSize) | ||
| { | ||
| // We don't have enough bytes buffered, so issue an initial read to try to get enough. This is |
There was a problem hiding this comment.
This comment isn't really correct anymore
There was a problem hiding this comment.
What do you think is incorrect? I'm reading it again and it seems to describe the intent.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| private SecurityStatusPal DecryptData(int frameSize, out int decryptedCount, out int decryptedOffset) | ||
| { | ||
| // Set _decrytpedBytesOffset/Count to the current frame we have (including header) |
There was a problem hiding this comment.
Seems like we should assert that _decryptedBytesCount is 0 here, right? Otherwise we could be overwriting unconsumed decrypted data.
There was a problem hiding this comment.
| // Set _decrytpedBytesOffset/Count to the current frame we have (including header) | |
| // Set _decryptedBytesOffset/Count to the current frame we have (including header) |
Uh oh!
There was an error while loading. Please reload this page.
| TlsFrameHelper.TryGetFrameHeader(_internalBuffer.AsSpan(_internalOffset), ref _lastFrame.Header); | ||
| if (_lastFrame.Header.Type != TlsContentType.AppData) | ||
| { | ||
| // Alerts, handshake and anything else will be processed separately. |
There was a problem hiding this comment.
Why? Seems like it's better to process these sooner rather than later. And there could be more data in subsequent frames as well, right?
There was a problem hiding this comment.
I'm worried about compatibility. Goal of this change is efficiency, not behavior changes. While I don't have specific example (besides the AUX tests) currently all the additional service frames would be processed after handing out data received prior.
There was a problem hiding this comment.
Ok, seems reasonable. Can we at least add a comment that this probably isn't strictly necessary?
Uh oh!
There was an error while loading. Please reload this page.
wfurt
commented
Jun 14, 2021
This should be ready for another review round @geoffkizer@stephentoub. With exception of the Async debate all the feedback should be addressed. |
karelz
commented
Jun 16, 2021
@geoffkizer can you please finish code review here? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
geoffkizer
left a comment
There was a problem hiding this comment.
A couple nits above. Generally LGTM
davidfowl
commented
Jun 24, 2021
👍🏾 |
…bugger2 * origin/main: (107 commits) Disable MacCatalyst arm64 PR test runs on staging pipeline (dotnet#54678) [WASM] Fix async/await in config loading (dotnet#54652) Fix for heap_use_after_free flagged by sanitizer (dotnet#54679) [wasm] Bump emscripten to 2.0.23 (dotnet#53603) Fix compiler references when building inside VS (dotnet#54614) process more TLS frames at one when available (dotnet#50815) Add PeriodicTimer (dotnet#53899) UdpClient with span support (dotnet#53429) exclude fragile tests (dotnet#54671) get last error before calling a method that might fail as well (dotnet#54667) [FileStream] add tests for device and UNC paths (dotnet#54545) Fix sporadic double fd close (dotnet#54660) Remove Version.Clone from AssemblyName.Clone (dotnet#54621) [wasm] Enable fixed libraries tests (dotnet#54641) [wasm] Fix blazor/aot builds (dotnet#54651) [mono][wasm] Fix compilation error on wasm (dotnet#54659) Fix telemetry for Socket connects to Dns endpoints (dotnet#54071) [wasm] Build static components; include hot_reload in runtime (dotnet#54568) [wasm][debugger] Reuse debugger-agent on wasm debugger (dotnet#52300) Put Crossgen2 in sync with dotnet#54235 (dotnet#54438) ...
This reverts commit 2ac023c.
This is fragment of original #49743
This change will process more frames if already read from transport returning bigger chunks of data to caller.
Aside from the big loop change this adds more spanification and tracing for EOF as we may reach it while already decrypted some data.
AuxRecord tests are removed as they depend on particular read side.
fixes#49000