Repository navigation
Agent changes to use HTTP 1.1 on Linux and OSX - #1970
Tingluo Huang (TingluoHuang) merged 4 commits into
Conversation
| protected async override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) | ||
| { | ||
| #if OS_LINUX | ||
| request.Version = HttpVersion.Version11; |
There was a problem hiding this comment.
i don't think we need this, this is still using the vsshttpmessagehandler
There was a problem hiding this comment.
Yeah, let me double check. I introduced this code back from when I took the original approach of specifying the version when getting the HTTP client.
There was a problem hiding this comment.
This override is not needed now. Removed.
| CancellationToken cancellationToken) | ||
| { | ||
| #if OS_LINUX | ||
| request.Version = HttpVersion.Version11; |
There was a problem hiding this comment.
not sure about this, check where HttpRetryOnTimeoutMessageHandler was added.
There was a problem hiding this comment.
Looks like this handler is configured independently, and never calls the VSS handler. I'll keep the override in this case.
|
|
||
| VssClientHttpRequestSettings.Default.UserAgent = headerValues; | ||
| VssClientHttpRequestSettings.Default.ClientCertificateManager = clientCert; | ||
| #if OS_LINUX |
There was a problem hiding this comment.
what about OSX?
There was a problem hiding this comment.
Does OSX also use Curl as the HTTP request backend? If so, I'm good with including OSX as well.
There was a problem hiding this comment.
https://spin.atomicobject.com/2017/09/28/net-core-osx-libcurl-openssl/
OSX does use Curl as the backend. I'll update the condition.
4fb4df4 to
bfdfc96
Compare
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Net; |
There was a problem hiding this comment.
extra stuff. :D
|
Julio Barba (@juliobbv) i build vss-api |
|
Tingluo Huang (@TingluoHuang) thanks Ting! I'll update my PR tomorrow to consume the new bits. |
There was a problem hiding this comment.
why we need ToString()?
There was a problem hiding this comment.
The ToString() is needed to react to the changes Zac made where the Endpoint.Name is now an ExpressionValue<string> instead of string. I synced up with Zac, and this is the preferred way to get the resolved name.
There was a problem hiding this comment.
do we have to remove this?
There was a problem hiding this comment.
The UpdateBuildAsync() overload with the projectId and buildId parameters passed in is now deprecated (I got a build warning alerting me of this fact).
The new overload reads projectIdand buildId from the build object, which we're already doing in the code anyways, so there's effectively no functional change.
There was a problem hiding this comment.
i worried about back compat, latest client talk to TFS2017, double check with Build Team, make sure their client is back compat.
There was a problem hiding this comment.
search for InitializeVssConnection, there might be 2 more places we need to change.
There was a problem hiding this comment.
You were right. I updated those two places to also specify UseHttp11
11a1c2e to
c786558
Compare
|
Hey Tingluo Huang (@TingluoHuang), thanks for merging my PR! 😄 |
The .NET Core 2.1 runtime switched its HTTP default from HTTP 1.1 to HTTP 2.
This causes problems with some versions of the Curl handler.
See https://github.com/dotnet/corefx/issues/32376 for more details.