Skip to content

Commit

Permalink
Merge ServicePoint assembly into Requests (dotnet#94510)
Browse files Browse the repository at this point in the history
* Initial commit for merge

* Change csproj and sln files

* Fix solution files

* Add newlines into ServicePoint files

* Delete ServicePoint folder and merge tests

* Add TypeForwardedFrom

* Update src/libraries/shims/System.Net.ServicePoint/src/System.Net.ServicePoint.csproj

Co-authored-by: Viktor Hofer <[email protected]>

* Review feedback

* ignore browser CI for ServicePoint

---------

Co-authored-by: Viktor Hofer <[email protected]>
  • Loading branch information
liveans and ViktorHofer authored Nov 9, 2023
1 parent fe386c0 commit 0af8b25
Show file tree
Hide file tree
Showing 28 changed files with 91 additions and 395 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@
<Compile Include="System\Net\Managed\HttpResponseStream.Managed.cs" />
<Compile Include="System\Net\Managed\WebSockets\HttpWebSocket.Managed.cs" />
<Reference Include="System.Net.Sockets" />
<Reference Include="System.Net.ServicePoint" />
<Reference Include="System.Threading.ThreadPool" />
</ItemGroup>

Expand Down
7 changes: 0 additions & 7 deletions src/libraries/System.Net.Mail/System.Net.Mail.sln
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Net.Primitives", "..
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Net.Security", "..\System.Net.Security\ref\System.Net.Security.csproj", "{63AD4246-28A6-4FFC-9864-F49BE7EA06A0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Net.ServicePoint", "..\System.Net.ServicePoint\ref\System.Net.ServicePoint.csproj", "{0FC3D1DF-6D65-4319-967D-CD3870500060}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.ObjectModel", "..\System.ObjectModel\ref\System.ObjectModel.csproj", "{15058CBC-DF6D-4B1A-A9B1-C4B6ADF2B8A5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComInterfaceGenerator", "..\System.Runtime.InteropServices\gen\ComInterfaceGenerator\ComInterfaceGenerator.csproj", "{628EF453-C5BA-437B-9467-A037E19C945E}"
Expand Down Expand Up @@ -153,10 +151,6 @@ Global
{63AD4246-28A6-4FFC-9864-F49BE7EA06A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63AD4246-28A6-4FFC-9864-F49BE7EA06A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63AD4246-28A6-4FFC-9864-F49BE7EA06A0}.Release|Any CPU.Build.0 = Release|Any CPU
{0FC3D1DF-6D65-4319-967D-CD3870500060}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0FC3D1DF-6D65-4319-967D-CD3870500060}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0FC3D1DF-6D65-4319-967D-CD3870500060}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0FC3D1DF-6D65-4319-967D-CD3870500060}.Release|Any CPU.Build.0 = Release|Any CPU
{15058CBC-DF6D-4B1A-A9B1-C4B6ADF2B8A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{15058CBC-DF6D-4B1A-A9B1-C4B6ADF2B8A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{15058CBC-DF6D-4B1A-A9B1-C4B6ADF2B8A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -245,7 +239,6 @@ Global
{A743A5C2-5DE7-433B-A623-893B0BAE83D8} = {A08D08E8-610F-47A0-8747-01223F9430C5}
{CB0B59AC-EDF4-4900-AFA1-8D9FBBD1355B} = {A08D08E8-610F-47A0-8747-01223F9430C5}
{63AD4246-28A6-4FFC-9864-F49BE7EA06A0} = {A08D08E8-610F-47A0-8747-01223F9430C5}
{0FC3D1DF-6D65-4319-967D-CD3870500060} = {A08D08E8-610F-47A0-8747-01223F9430C5}
{15058CBC-DF6D-4B1A-A9B1-C4B6ADF2B8A5} = {A08D08E8-610F-47A0-8747-01223F9430C5}
{D73EDC80-4293-4F5F-876C-5375AB40562D} = {A08D08E8-610F-47A0-8747-01223F9430C5}
{C693DF8E-4146-4EED-903A-FBB725D83595} = {A08D08E8-610F-47A0-8747-01223F9430C5}
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/System.Net.Mail/ref/System.Net.Mail.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<ProjectReference Include="$(LibrariesProjectRoot)System.Collections.Specialized\ref\System.Collections.Specialized.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.ComponentModel.EventBasedAsync\ref\System.ComponentModel.EventBasedAsync.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Net.Primitives\ref\System.Net.Primitives.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Net.ServicePoint\ref\System.Net.ServicePoint.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Net.Requests\ref\System.Net.Requests.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Runtime\ref\System.Runtime.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Security.Cryptography\ref\System.Security.Cryptography.csproj" />
</ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion src/libraries/System.Net.Mail/src/System.Net.Mail.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@
<Reference Include="System.Net.Primitives" />
<Reference Include="System.Net.Requests" />
<Reference Include="System.Net.Security" />
<Reference Include="System.Net.ServicePoint" />
<Reference Include="System.Net.Sockets" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.InteropServices" />
Expand Down
14 changes: 7 additions & 7 deletions src/libraries/System.Net.Requests/System.Net.Requests.sln
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Net.Requests.Tests",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Net.Security", "..\System.Net.Security\ref\System.Net.Security.csproj", "{0F98EB0F-47BC-4FA8-AAF9-984EA5EA82F6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Net.ServicePoint", "..\System.Net.ServicePoint\ref\System.Net.ServicePoint.csproj", "{3591028D-F67E-49B9-A102-13D213A8322F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Net.WebHeaderCollection", "..\System.Net.WebHeaderCollection\ref\System.Net.WebHeaderCollection.csproj", "{039447FE-18F8-4BB1-9635-7CCA2B3E0D57}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.ObjectModel", "..\System.ObjectModel\ref\System.ObjectModel.csproj", "{65D5CFD7-A40B-43D4-B17C-DC3AA8857224}"
Expand Down Expand Up @@ -73,6 +71,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "tools\ref", "{213121
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{0CCB356A-4A4E-4CDB-8407-BF91880E5E9A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Net.ServicePoint.Tests", "tests\ServicePointTests\System.Net.ServicePoint.Tests.csproj", "{A7864A13-E626-4124-9A4C-61BD77C4CBB8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -135,10 +135,6 @@ Global
{0F98EB0F-47BC-4FA8-AAF9-984EA5EA82F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0F98EB0F-47BC-4FA8-AAF9-984EA5EA82F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0F98EB0F-47BC-4FA8-AAF9-984EA5EA82F6}.Release|Any CPU.Build.0 = Release|Any CPU
{3591028D-F67E-49B9-A102-13D213A8322F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3591028D-F67E-49B9-A102-13D213A8322F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3591028D-F67E-49B9-A102-13D213A8322F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3591028D-F67E-49B9-A102-13D213A8322F}.Release|Any CPU.Build.0 = Release|Any CPU
{039447FE-18F8-4BB1-9635-7CCA2B3E0D57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{039447FE-18F8-4BB1-9635-7CCA2B3E0D57}.Debug|Any CPU.Build.0 = Debug|Any CPU
{039447FE-18F8-4BB1-9635-7CCA2B3E0D57}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -195,6 +191,10 @@ Global
{F01F38EB-B9A4-46EA-B11C-AE5C65BD0371}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F01F38EB-B9A4-46EA-B11C-AE5C65BD0371}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F01F38EB-B9A4-46EA-B11C-AE5C65BD0371}.Release|Any CPU.Build.0 = Release|Any CPU
{A7864A13-E626-4124-9A4C-61BD77C4CBB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A7864A13-E626-4124-9A4C-61BD77C4CBB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A7864A13-E626-4124-9A4C-61BD77C4CBB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A7864A13-E626-4124-9A4C-61BD77C4CBB8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -213,7 +213,6 @@ Global
{A9FABDAE-CB4B-4EEE-87CE-89CE22810E2F} = {DB20495E-C9F0-4640-85A6-ACEF17C21670}
{60B3EE55-D545-4817-A57D-99F38CBCD1A8} = {DB20495E-C9F0-4640-85A6-ACEF17C21670}
{0F98EB0F-47BC-4FA8-AAF9-984EA5EA82F6} = {DB20495E-C9F0-4640-85A6-ACEF17C21670}
{3591028D-F67E-49B9-A102-13D213A8322F} = {DB20495E-C9F0-4640-85A6-ACEF17C21670}
{039447FE-18F8-4BB1-9635-7CCA2B3E0D57} = {DB20495E-C9F0-4640-85A6-ACEF17C21670}
{65D5CFD7-A40B-43D4-B17C-DC3AA8857224} = {DB20495E-C9F0-4640-85A6-ACEF17C21670}
{3091C143-0DE3-4AF8-8F19-87DA0F0F2E5F} = {DB20495E-C9F0-4640-85A6-ACEF17C21670}
Expand All @@ -232,6 +231,7 @@ Global
{8F842012-E5B7-4806-BF53-7F1EDAC7F4DD} = {0CCB356A-4A4E-4CDB-8407-BF91880E5E9A}
{F01F38EB-B9A4-46EA-B11C-AE5C65BD0371} = {213121F9-0C28-4322-A0F0-07B6C5818923}
{213121F9-0C28-4322-A0F0-07B6C5818923} = {0CCB356A-4A4E-4CDB-8407-BF91880E5E9A}
{A7864A13-E626-4124-9A4C-61BD77C4CBB8} = {2E80965D-0AB1-451E-AFE5-E4CAF49EE8E3}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D33CD477-CBDE-47CC-BDAB-7E9469CE3549}
Expand Down
59 changes: 59 additions & 0 deletions src/libraries/System.Net.Requests/ref/System.Net.Requests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,65 @@ protected virtual void GetObjectData(System.Runtime.Serialization.SerializationI
[System.ObsoleteAttribute("Serialization has been deprecated for WebResponse.")]
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext) { }
}
public delegate System.Net.IPEndPoint BindIPEndPoint(System.Net.ServicePoint servicePoint, System.Net.IPEndPoint remoteEndPoint, int retryCount);
[System.FlagsAttribute]
public enum SecurityProtocolType
{
SystemDefault = 0,
[System.ObsoleteAttribute("SecurityProtocolType.Ssl3 has been deprecated and is not supported.")]
Ssl3 = 48,
Tls = 192,
Tls11 = 768,
Tls12 = 3072,
Tls13 = 12288,
}
public partial class ServicePoint
{
internal ServicePoint() { }
public System.Uri Address { get { throw null; } }
public System.Net.BindIPEndPoint? BindIPEndPointDelegate { get { throw null; } set { } }
public System.Security.Cryptography.X509Certificates.X509Certificate? Certificate { get { throw null; } }
public System.Security.Cryptography.X509Certificates.X509Certificate? ClientCertificate { get { throw null; } }
public int ConnectionLeaseTimeout { get { throw null; } set { } }
public int ConnectionLimit { get { throw null; } set { } }
public string ConnectionName { get { throw null; } }
public int CurrentConnections { get { throw null; } }
public bool Expect100Continue { get { throw null; } set { } }
public System.DateTime IdleSince { get { throw null; } }
public int MaxIdleTime { get { throw null; } set { } }
public virtual System.Version ProtocolVersion { get { throw null; } }
public int ReceiveBufferSize { get { throw null; } set { } }
public bool SupportsPipelining { get { throw null; } }
public bool UseNagleAlgorithm { get { throw null; } set { } }
public bool CloseConnectionGroup(string connectionGroupName) { throw null; }
public void SetTcpKeepAlive(bool enabled, int keepAliveTime, int keepAliveInterval) { }
}
public partial class ServicePointManager
{
internal ServicePointManager() { }
public const int DefaultNonPersistentConnectionLimit = 4;
public const int DefaultPersistentConnectionLimit = 2;
public static bool CheckCertificateRevocationList { get { throw null; } set { } }
public static int DefaultConnectionLimit { get { throw null; } set { } }
public static int DnsRefreshTimeout { get { throw null; } set { } }
public static bool EnableDnsRoundRobin { get { throw null; } set { } }
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static System.Net.Security.EncryptionPolicy EncryptionPolicy { get { throw null; } }
public static bool Expect100Continue { get { throw null; } set { } }
public static int MaxServicePointIdleTime { get { throw null; } set { } }
public static int MaxServicePoints { get { throw null; } set { } }
public static bool ReusePort { get { throw null; } set { } }
public static System.Net.SecurityProtocolType SecurityProtocol { get { throw null; } set { } }
public static System.Net.Security.RemoteCertificateValidationCallback? ServerCertificateValidationCallback { get { throw null; } set { } }
public static bool UseNagleAlgorithm { get { throw null; } set { } }
[System.ObsoleteAttribute("WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.", DiagnosticId = "SYSLIB0014", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public static System.Net.ServicePoint FindServicePoint(string uriString, System.Net.IWebProxy? proxy) { throw null; }
[System.ObsoleteAttribute("WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.", DiagnosticId = "SYSLIB0014", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public static System.Net.ServicePoint FindServicePoint(System.Uri address) { throw null; }
[System.ObsoleteAttribute("WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.", DiagnosticId = "SYSLIB0014", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public static System.Net.ServicePoint FindServicePoint(System.Uri address, System.Net.IWebProxy? proxy) { throw null; }
public static void SetTcpKeepAlive(bool enabled, int keepAliveTime, int keepAliveInterval) { }
}
}
namespace System.Net.Cache
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<ProjectReference Include="$(LibrariesProjectRoot)System.Collections.Specialized\ref\System.Collections.Specialized.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Net.Primitives\ref\System.Net.Primitives.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Net.Security\ref\System.Net.Security.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Net.ServicePoint\ref\System.Net.ServicePoint.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Net.WebHeaderCollection\ref\System.Net.WebHeaderCollection.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Runtime\ref\System.Runtime.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Security.Cryptography\ref\System.Security.Cryptography.csproj" />
Expand Down
3 changes: 3 additions & 0 deletions src/libraries/System.Net.Requests/src/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -258,4 +258,7 @@
<data name="CacheEntryNotFound" xml:space="preserve">
<value>The request was aborted: The request cache-only policy does not allow a network request and the response is not found in cache.</value>
</data>
<data name="net_proxyschemenotsupported" xml:space="preserve">
<value>The ServicePointManager does not support proxies with the {0} scheme.</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
<Compile Include="System\Net\Cache\HttpRequestCacheLevel.cs" />
<Compile Include="System\Net\Cache\HttpRequestCachePolicy.cs" />
<Compile Include="System\Net\NetEventSource.Requests.cs" />
<Compile Include="System\Net\ServicePoint\BindIPEndPoint.cs" />
<Compile Include="System\Net\ServicePoint\SecurityProtocolType.cs" />
<Compile Include="System\Net\ServicePoint\ServicePoint.cs" />
<Compile Include="System\Net\ServicePoint\ServicePointManager.cs" />
<Compile Include="$(CommonPath)System\Obsoletions.cs"
Link="Common\System\Obsoletions.cs" />
<Compile Include="$(CommonPath)System\Net\Http\HttpHandlerDefaults.cs"
Expand Down Expand Up @@ -99,14 +103,14 @@
<ItemGroup>
<Reference Include="Microsoft.Win32.Primitives" />
<Reference Include="System.Collections" />
<Reference Include="System.Collections.Concurrent" />
<Reference Include="System.Collections.NonGeneric" />
<Reference Include="System.Collections.Specialized" />
<Reference Include="System.Diagnostics.Tracing" />
<Reference Include="System.Memory" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Primitives" />
<Reference Include="System.Net.Security" />
<Reference Include="System.Net.ServicePoint" />
<Reference Include="System.Net.Sockets" />
<Reference Include="System.Net.WebHeaderCollection" />
<Reference Include="System.Runtime" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<!-- SYSLIB0014: WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead. -->
<NoWarn>$(NoWarn);SYSLIB0014</NoWarn>
<IgnoreForCI Condition="'$(TargetOS)' == 'browser'">true</IgnoreForCI>
</PropertyGroup>
<ItemGroup>
<Compile Include="ServicePointManagerTest.cs" />
Expand Down
Loading

0 comments on commit 0af8b25

Please sign in to comment.