Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error downloading Plugin after updating #110

Closed
Riiskyy opened this issue Aug 20, 2024 · 2 comments
Closed

Error downloading Plugin after updating #110

Riiskyy opened this issue Aug 20, 2024 · 2 comments

Comments

@Riiskyy
Copy link

Riiskyy commented Aug 20, 2024

I'm still getting these errors when IINACT updates. On #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
Copy link
Author

Riiskyy commented Aug 20, 2024

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
Copy link
Author

Riiskyy commented Sep 1, 2024

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

@Riiskyy Riiskyy closed this as completed Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant