@@ -1108,6 +1108,14 @@ void PluginInfoComponent::run()
11081108
11091109 LOGE (" Error.. Plugin already in use. Please remove it from the signal chain and try again." );
11101110 }
1111+ else if (dlReturnCode == HTTP_ERR)
1112+ {
1113+ AlertWindow::showMessageBoxAsync (AlertWindow::WarningIcon,
1114+ " [Plugin Installer] " + pInfo.displayName ,
1115+ " HTTP request failed!!\n Please check your internet connection..." );
1116+
1117+ LOGE (" HTTP request failed!! Please check your internet connection..." );
1118+ }
11111119
11121120}
11131121
@@ -1308,24 +1316,16 @@ int PluginInfoComponent::downloadPlugin(const String& plugin, const String& vers
13081316
13091317 String filename = plugin + " -" + osType + " _" + version + " .zip" ;
13101318
1311- // Unzip plugin and install in plugins directory
1312- // curl -L https://dl.bintray.com/$bintrayUser/$repo/$filename
1313-
13141319 URL fileUrl (fileDownloadURL);
13151320
1316- int statusC;
1317- StringPairArray responseHeaders;
1318-
13191321 // Create input stream from the plugin's zip file URL
1320- std::unique_ptr<InputStream> fileStream = fileUrl.createInputStream (false , nullptr , nullptr , String (), 1000 , &responseHeaders, &statusC, 5 , String ());
1321- String newLocation = responseHeaders.getValue (" Location" , " NULL" );
1322+ std::unique_ptr<InputStream> fileStream = fileUrl.createInputStream (URL::InputStreamOptions (URL::ParameterHandling::inAddress)
1323+ .withConnectionTimeoutMs (1000 )
1324+ .withNumRedirectsToFollow (5 ));
13221325
1323- // ZIP URL Location changed, use the new location
1324- if (newLocation != " NULL" )
1325- {
1326- fileUrl = newLocation;
1327- fileStream = fileUrl.createInputStream (false );
1328- }
1326+ // Could not retrieve data
1327+ if (!fileStream)
1328+ return 9 ;
13291329
13301330 // ZIP file empty, return.
13311331 if (fileStream->getTotalLength () == 0 )
0 commit comments