marzent / IINACT

A Dalamud plugin to run the FFXIV_ACT_Plugin in an ACT-like enviroment with a heavily modified port of Overlay Plugin
https://www.iinact.com
GNU General Public License v3.0
182 stars 42 forks source link

Error downloading Plugin after updating #110

Closed Riiskyy closed 1 week ago

Riiskyy commented 3 weeks ago

I'm still getting these errors when IINACT updates. On https://github.com/marzent/IINACT/issues/106 you said that this was an issue downloading the files. However after looking over FetchDependencies.cs I found the URL that the plugin attempts to connect to in order to download the FFXIV_ACT_PLUGIN and I can connect to the URL from my browser just fine and download the files and they download in less than a second.

I don't really know C# to troubleshoot well enough but I do know PowerShell which also leverages .NET and so I ran a test:

t1@RhodesIsland ~ $PluginUrlGlobal = "https://www.iinact.com/updater/download"
t1@RhodesIsland ~
t1@RhodesIsland ~ $StopWatch = [Diagnostics.Stopwatch]::StartNew()
t1@RhodesIsland ~ Invoke-WebRequest -Uri $PluginUrlGlobal -Method Get -OutFile ".\Desktop\FFXIV_ACT_Plugin_2.7.1.8.zip"
t1@RhodesIsland ~ $StopWatch.Stop()
t1@RhodesIsland ~ $StopWatchw.Elapsed
t1@RhodesIsland ~
t1@RhodesIsland ~ $DownloadFile = ".\Desktop\FFXIV_ACT_Plugin_2.7.1.8.zip"
t1@RhodesIsland ~
t1@RhodesIsland ~ $Zip = [IO.Compression.ZipFile]::OpenRead($DownloadFile)
t1@RhodesIsland ~
t1@RhodesIsland ~ $Entries = $Zip.Entries
t1@RhodesIsland ~
t1@RhodesIsland ~ $Zip.Dispose()
t1@RhodesIsland ~
t1@RhodesIsland ~ $Entries | Select Name, Length

Name                         Length
----                         ------
FFXIV_ACT_Plugin.dll        2213888
deucalion-1.1.0.distrib.dll 3139832

t1@RhodesIsland ~ $StopWatch.Elapsed

Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 37
Milliseconds      : 896
Ticks             : 378962584
TotalDays         : 0.000438614101851852
TotalHours        : 0.0105267384444444
TotalMinutes      : 0.631604306666667
TotalSeconds      : 37.8962584
TotalMilliseconds : 37896.2584

When downloading via .NET framework the download is taking 37 seconds which, from looking at the FetchDependencies.cs file, times out after 37 seconds. I'm not sure how I can go about testing what is causing the delay.

Riiskyy commented 3 weeks ago

Just to make sure it wasn't something funky with PowerShell I tried just using .NET functions with the same result

t1@RhodesIsland ~ $uri = [uri]'https://www.iinact.com/updater/download'
t1@RhodesIsland ~
t1@RhodesIsland ~ $stopwatch = [System.Diagnostics.Stopwatch]::new()
t1@RhodesIsland ~
t1@RhodesIsland ~ $request = [System.Net.HttpWebRequest]::Create($uri)
t1@RhodesIsland ~
t1@RhodesIsland ~ $stopwatch.Restart()
t1@RhodesIsland ~
t1@RhodesIsland ~ $responseStream = $request.GetResponse().GetResponseStream()
t1@RhodesIsland ~ $FilePath = "$env:USERPROFILE\Desktop\FFXIV_ACT_Plugin_2.7.1.8.zip"
t1@RhodesIsland ~
t1@RhodesIsland ~ $targetStream = [System.IO.FileStream]::new($FilePath, 'Create')
t1@RhodesIsland ~
t1@RhodesIsland ~ $buffer = [System.Byte[]]::new(10Kb)
t1@RhodesIsland ~
t1@RhodesIsland ~ do {
>     $count = $responseStream.Read($buffer, 0, $buffer.Length)
>     $targetStream.Write($buffer, 0, $count)
>
> } while ($count -gt 0)
t1@RhodesIsland ~
t1@RhodesIsland ~ $stopwatch.Stop()
t1@RhodesIsland ~
t1@RhodesIsland ~ $targetStream.Dispose()
t1@RhodesIsland ~ $responseStream.Dispose()
t1@RhodesIsland ~
t1@RhodesIsland ~ return $stopwatch.Elapsed

Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 38
Milliseconds      : 756
Ticks             : 387563667
TotalDays         : 0.000448569059027778
TotalHours        : 0.0107656574166667
TotalMinutes      : 0.645939445
TotalSeconds      : 38.7563667
TotalMilliseconds : 38756.3667
Riiskyy commented 1 week ago

After noticing this ffecting other apps I've done some more investigation and found the issue to be with my DNS over HTTPS resolver. I have switched DNS providers and I am now seeing the same code finish in 2 seconds

Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 2
Milliseconds      : 837
Ticks             : 28377051
TotalDays         : 3.28438090277778E-05
TotalHours        : 0.000788251416666667
TotalMinutes      : 0.047295085
TotalSeconds      : 2.8377051
TotalMilliseconds : 2837.7051