Skip to content

Commit

Permalink
Merge branch 'master' into update/builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Olympic1 authored Jul 10, 2020
2 parents b8e997b + ba54c79 commit 3e7e29e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Cmdline/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public static int Main(string[] args)
// This is on by default in .NET 4.6, but not in 4.5.
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;

// Make sure Curl is all set up
Curl.Init();

try
{
return Execute(null, null, args);
Expand Down
11 changes: 9 additions & 2 deletions Core/Net/Curl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,15 @@ public static void Init()
Log.Info("Curl init already performed, not running twice");
return;
}
CurlSharp.Curl.GlobalInit(CurlInitFlag.All);
_initComplete = true;
try
{
CurlSharp.Curl.GlobalInit(CurlInitFlag.All);
_initComplete = true;
}
catch (DllNotFoundException)
{
Log.Info("Curl initialization failed. Maybe you should install the DLL?\r\n\r\nhttps://github.com/KSP-CKAN/CKAN/wiki/libcurl");
}
}

/// <summary>
Expand Down
5 changes: 4 additions & 1 deletion Netkan/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static int Main(string[] args)
h.AddDashesToOption = true;
h.AutoHelp = false;
h.Heading = $"NetKAN {Meta.GetVersion(VersionFormat.Full)}";
h.Copyright = $"Copyright © 2014-{DateTime.Now.Year}";
h.Copyright = $"Copyright 2014-{DateTime.Now.Year}";
return HelpText.DefaultParsingErrorsHandler(parser, h);
}, e => e, true);
Console.WriteLine(ht);
Expand Down Expand Up @@ -85,6 +85,9 @@ private static int Run(CmdLineOptions options)
// Make sure Curl is all set up
Curl.Init();

// Make sure Curl is all set up
Curl.Init();

if (!string.IsNullOrEmpty(Options.ValidateCkan))
{
var ckan = new Metadata(JObject.Parse(File.ReadAllText(Options.ValidateCkan)));
Expand Down

0 comments on commit 3e7e29e

Please sign in to comment.