Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ HandleAltSvc()

void System.Net.Http.HttpConnectionPool.HandleAltSvc ( IEnumerable< string > altSvcHeaderValues,
TimeSpan? responseAge )
inlinepackage

Definition at line 868 of file HttpConnectionPool.cs.

869 {
870 HttpAuthority httpAuthority = null;
871 TimeSpan dueTime = default(TimeSpan);
872 bool flag = false;
873 foreach (string altSvcHeaderValue2 in altSvcHeaderValues)
874 {
875 int index = 0;
877 {
878 continue;
879 }
882 {
885 break;
886 }
887 if (httpAuthority != null || altSvcHeaderValue == null || !(altSvcHeaderValue.AlpnProtocolName == "h3"))
888 {
889 continue;
890 }
891 HttpAuthority httpAuthority2 = new HttpAuthority(altSvcHeaderValue.Host ?? _originAuthority.IdnHost, altSvcHeaderValue.Port);
893 {
895 if (responseAge.HasValue)
896 {
897 maxAge -= responseAge.GetValueOrDefault();
898 }
899 if (maxAge > TimeSpan.Zero)
900 {
902 dueTime = maxAge;
903 flag = altSvcHeaderValue.Persist;
904 }
905 }
906 }
907 if (httpAuthority == null || httpAuthority.Equals(_http3Authority))
908 {
909 return;
910 }
911 if (dueTime.Ticks > 25920000000000L)
912 {
913 dueTime = TimeSpan.FromTicks(25920000000000L);
914 }
915 lock (SyncObj)
916 {
917 if (_authorityExpireTimer == null)
918 {
920 bool flag2 = false;
921 try
922 {
924 {
926 flag2 = true;
927 }
929 {
931 if (weakReference.TryGetTarget(out var target))
932 {
933 target.ExpireAltSvcAuthority();
934 }
936 }
937 finally
938 {
939 if (flag2)
940 {
942 }
943 }
944 }
945 else
946 {
948 }
950 _persistAuthority = flag;
951 }
952 if (!flag)
953 {
955 }
956 }
readonly HttpConnectionPoolManager _poolManager
bool IsAltSvcBlocked(HttpAuthority authority)
static AsyncFlowControl SuppressFlow()
static readonly TimeSpan InfiniteTimeSpan
Definition Timeout.cs:5
bool Change(int dueTime, int period)
Definition Timer.cs:131

References System.Net.Http.HttpConnectionPool._authorityExpireTimer, System.Net.Http.HttpConnectionPool._http3Authority, System.Net.Http.HttpConnectionPool._originAuthority, System.Net.Http.HttpConnectionPool._persistAuthority, System.Net.Http.HttpConnectionPool._poolManager, System.Threading.Timer.Change(), System.Net.Http.Headers.AltSvcHeaderValue.Clear, System.Net.Http.HttpConnectionPool.ExpireAltSvcAuthority(), System.TimeSpan.FromTicks(), System.Net.Http.HttpAuthority.IdnHost, System.index, System.Threading.Timeout.InfiniteTimeSpan, System.Net.Http.HttpConnectionPool.IsAltSvcBlocked(), System.Threading.ExecutionContext.IsFlowSuppressed(), System.L, System.Net.Http.Headers.AltSvcHeaderParser.Parser, System.Threading.ExecutionContext.RestoreFlow(), System.Net.Http.HttpConnectionPoolManager.StartMonitoringNetworkChanges(), System.state, System.Threading.ExecutionContext.SuppressFlow(), System.Net.Http.HttpConnectionPool.SyncObj, and System.TimeSpan.Zero.

Referenced by System.Net.Http.HttpConnectionPool.ProcessAltSvc(), and System.Net.Http.Http2Connection.ProcessAltSvcFrame().