Hello. I’m having an issue with a user who is reporting an error of, “received no data in response”, when trying to download this image for example, https://gamedevhq.com/wp-content/uploads/2019/08/Thumbnail_Template_muzzle-flash-300x252.jpg. This issue isn’t exclusive to this image but this is an example of the domain it’s under.
This is an editor plugin and runs in the editor, not in-game.
Here’s the code for the download image method,
public static async Task<GetTextureResult> GetImage(string url, int parentId, int id)
{
try
{
UnityWebRequest request = UnityWebRequestTexture.GetTexture(url);
request.SendWebRequest();
while (request.isDone == false)
await Task.Delay(1);
if (request.isHttpError || request.isNetworkError || request.downloadHandler == null)
{
Logging.Log("[NetworkInterface] Errored on GET Image: " + url + ", " + request.error);
connected = false;
return new GetTextureResult { parentId = parentId, id = id, texture = null };
}
Texture myTexture = ((DownloadHandlerTexture)request.downloadHandler).texture;
if (myTexture == null)
{
Logging.Log("[NetworkInterface] No image found!");
connected = false;
}
request.Dispose();
return new GetTextureResult() { parentId = parentId, id = id, texture = myTexture };
}
catch(Exception e)
{
return null;
}
}
We have thousands of requests from hundreds of users all using this method and only have had this issue reported two times.
The first time I was able to resolve it by seeing that the error wasn’t being reported until the 70th call in a single frame, which I determined to be some kind of firewall protection on their end and added a delay to spread the requests out in time.
This time the error is being sent on the first request of the method. I did a teamviewer session with the user and couldn’t determine anything that would cause the 4.X API to not be active, and they were using Standalone as their build target. Pinging the server that the images are hosted returned a response, so they are able to connect to our servers. They are using Unity 2019.2.5f1 and the plugin is built as a DLL using the 2018.3.6f1 API.