Skip to content
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

Use an IBufferWriter<byte> to write the outgoing SSPI blob #2452

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

twsouthwick
Copy link
Member

@twsouthwick twsouthwick commented Apr 8, 2024

This change removes the need to pre-allocate anything for the outgoing blobs of SSPI generation. As part of this:

  • An internal implementation of ArrayBufferWriter is added for platforms that do not support it
  • SqlObjectPool is imbued with the ability to create/reset pooled objects
  • TdsParser/TdsLogin is updated to use pooled ArrayBufferWriter instances to generate SSPI blobs
  • Native methods are updated to take in Span/* for writeable byte[]
  • SSPIContextProvider signature is updated to take IBufferWriter

Part of #2253

This change removes the need to pre-allocate anything for the outgoing blobs of SSPI generation. As part of this:

- An internal implementation of ArrayBufferWriter is added for platforms that do not support it
- SqlObjectPool is imbued with the ability to create/reset pooled objects
- TdsParser/TdsLogin is updated to use pooled ArrayBufferWriter instances to generate SSPI blobs
- Native methods are updated to take in Span/* for writeable byte[]
- SSPIContextProvider signature is updated to take IBufferWriter
@twsouthwick twsouthwick marked this pull request as ready for review May 7, 2024 21:20
@twsouthwick
Copy link
Member Author

@David-Engel can I get a review on this next step in the SSPI journey?

Copy link

codecov bot commented May 8, 2024

Codecov Report

Attention: Patch coverage is 75.89286% with 27 lines in your changes are missing coverage. Please review.

Project coverage is 72.71%. Comparing base (48ab625) to head (6bc8358).
Report is 3 commits behind head on main.

❗ Current head 6bc8358 differs from pull request most recent head 1ec663f. Consider uploading reports for the commit 1ec663f to get more accurate results

Files Patch % Lines
.../src/Microsoft/Data/SqlClient/ArrayBufferWriter.cs 56.25% 21 Missing ⚠️
...osoft/Data/SqlClient/TdsParserStateObject.netfx.cs 72.22% 5 Missing ⚠️
...t/Data/SqlClient/SSPI/NativeSSPIContextProvider.cs 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2452      +/-   ##
==========================================
+ Coverage   72.68%   72.71%   +0.02%     
==========================================
  Files         313      314       +1     
  Lines       61727    61787      +60     
==========================================
+ Hits        44867    44926      +59     
- Misses      16860    16861       +1     
Flag Coverage Δ
addons 92.88% <ø> (ø)
netcore 77.02% <94.59%> (+0.05%) ⬆️
netfx 70.42% <73.52%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant