Repository navigation
Alt-Svc tests enabled and fixed for H/3 - #53786
Conversation
|
Tagging subscribers to this area: @dotnet/ncl Issue DetailsContributes to #53093
|
|
Tagging subscribers to this area: @dotnet/ncl Issue DetailsContributes to #53093
|
| private SemaphoreSlim? _http2ConnectionCreateLock; | ||
| private byte[]? _http2AltSvcOriginUri; | ||
| internal readonly byte[]? _http2EncodedAuthorityHostHeader; | ||
|
|
There was a problem hiding this comment.
I think this is here for analyzers, not for direct functional impact. Unless needed for the Alt-Svc I would probably not twist the changes together.
There was a problem hiding this comment.
For analyzers we have this one:
BTW, it's also used for linker (it has a static value thus linker can trim the guarded code out). So that's why I preferred to keep this separate from _http3Enabled.
| HttpClientHandler handler = CreateHttpClientHandler(HttpVersion.Version30); | ||
|
|
||
| return CreateHttpClient(handler); | ||
| var client = base.CreateHttpClient(); |
There was a problem hiding this comment.
Is it ok that version used in base.CreateHttpClientHandler() inside base.CreateHttpClient() will not be the same that is later set here to client.DefaultRequestVersion? Maybe it will be better to follow previous pattern to create handler and supply it to new client?
There was a problem hiding this comment.
I not 100% sure I understand what you mean. Could you share a snippet? BTW, I'm getting rid of the base., it's not needed since it's not virtual anymore.
There was a problem hiding this comment.
If you call CreateHttpClient() it will call CreateHttpClientHandler() without parameters
Which in its turn will pass
UseVersion (which will be 1.1 by default if I understand it correctly)So the version set to
HttpClient and the version used for handler creating will be different.What happens with
UseVersion in CreateHttpClientHandler might not be that important at the moment, but I have a feeling it might lead to bugs in the future in case CreateHttpClientHandler would be rewritten some day.
There was a problem hiding this comment.
UseVersion is overidden to H/2 and H/3 in the concrete class, e.g.:
https://github.com/ManickaP/runtime/blob/a07bc51c03add6e56bb5e36610f776584f52f8e6/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs#L3161-L3161
So the version set to HttpClient and the version used for handler creating will be different.
That's what I'm aiming for here though 😄 I need the client handler to be created with appropriate QuicImplementationProvider but also to have the request with different version than what the handler was created so that VersionHttpClientHandler does not overrides the VersionPolicy to exact and we can actually test the AltSvc.
It doesn't matter here if I use CreateHttpClient or CreateHttpClientHandler, I'd still need to set up DefaultVersionPolicy and DefaultRequestVersion on the client.
Contributes to #53093
Also
_http3Enabledis not a platform guard,IsHttp3Supportedis.