Search Unity

curl 65 webrequest error

Discussion in 'Scripting' started by AusAdam, Jul 3, 2022.

  1. AusAdam

    AusAdam

    Joined:
    Jan 2, 2021
    Posts:
    62
    After some more testing with the curl 65 error I have found the following
    .error returns Unknown Error
    .isdone returns true
    .responsecode returns 0
    .result returns ConnectionError
    .uploadedBytes returns 13

    Below is the code. It will work most of the time but then sometimes it just throws the curl 65 error,It Doesn't even try and contact the server. I am assuming it is a bug in the base code somewhere, I have included my code used to reproduce this error in Unity 2021.3.0f1 but it has been around for a long time.

    Code (CSharp):
    1. WWWForm form = new WWWForm();
    2.         form.AddField("aaaa", "7");
    3.         form.AddField("bbbb", "11");
    4.         string urlsend = urltoserverphpfile;
    5.         using (UnityWebRequest www = UnityWebRequest.Post(urlsend, form))
    6.         {
    7.             www.timeout = 10;
    8.             yield return www.SendWebRequest();
    9.             if (www.result == UnityWebRequest.Result.Success)
    10.             {
    11.                 string returndata = www.downloadHandler.text;
    12.                 Debug.Log(returndata);
    13.             }
    14.             else
    15.             {
    16.                 Debug.Log(" aa: " + www.error + "bb: " + www.isDone + "cc: " + www.responseCode + "dd: " + www.result + "ee: " + www.uploadedBytes);
    17.             }
    18.         }
     
  2. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,736
    Is this something that can be reliably reproduced?
    We have never received a reliable repro for such issue, so if you have one, it would be nice to get a bug report for this issue.
     
  3. AusAdam

    AusAdam

    Joined:
    Jan 2, 2021
    Posts:
    62
    I have a big feeling this is something to do with Asia, I am currently in thailand and it happens a lot. I wont be back in Australia for a few months to be able to test it there. When I run unity on my laptop here and even running the app on mobile it happens most of the time but Never on the first request normally when you make another request within 4-5 seconds, However if you make the request within 1-2 seconds I don't think I have seen it happen. When I connect my laptop to my vpn it was still happening However when I connected my laptop to Fiddler it does not happen at all.
     
  4. AusAdam

    AusAdam

    Joined:
    Jan 2, 2021
    Posts:
    62
    I just tested again then with fiddler and no curl errors. Without fiddler I was getting the curl errors if that helps.