Skip to content

Commit

Permalink
Merge pull request #826 from Unity-Technologies/unity-master-fix-andr…
Browse files Browse the repository at this point in the history
…oid-domainname-issue (case 935292)

Fix issue on android where HTTPClient.GetAsync will fail with libc error (case 935292)
  • Loading branch information
mderoy authored Jan 25, 2018
2 parents b117a3d + 5ef7ea5 commit ff33da9
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,17 @@ public override string DhcpScopeName {
public override string DomainName {
get {
byte [] bytes = new byte [256];
if (getdomainname (bytes, 256) != 0)
throw new NetworkInformationException ();
#if UNITY
try
{
#endif
if (getdomainname (bytes, 256) != 0)
throw new NetworkInformationException ();
#if UNITY
} catch (EntryPointNotFoundException) {
return String.Empty;
}
#endif
int len = Array.IndexOf<byte> (bytes, 0);
return Encoding.ASCII.GetString (bytes, 0, len < 0 ? 256 : len);
}
Expand Down

0 comments on commit ff33da9

Please sign in to comment.