Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Curl error but never on the first call #158

Open
ehovaere opened this issue Nov 20, 2020 · 1 comment
Open

Curl error but never on the first call #158

ehovaere opened this issue Nov 20, 2020 · 1 comment

Comments

@ehovaere
Copy link

ehovaere commented Nov 20, 2020

Hi,

I'll try to explain my problem.

I'm using the 2.6.1 rest client and I'm calling an API from Unity with it.
For a particular endpoint, for the very first time I'm calling it, it will be ok and the next calls too.
I then stop my application and re-run it and then, for an unknow reason, I will meet the following error

'Curl error 56: Receiving data failed with unitytls error code 1048578'
'Proyecto26.RequestException: Failed to receive data'

To be more precise about the repro steps.
Let's say I've got 2 website A & B with multiple endoints...

  • calling endpoint on A -->OK
  • calling another endpoint on A -->OK
  • calling auth endpoint on B->OK
    // sequence of calls
  • calling some endpoint on B --> OK
  • ....
  • calling some endpoint on B --> KO for some 500 errors...

while I meet an error during the "sequence of calls" I can rerun the app without be blocked at the auth phase.
Once all the calls are OK (and it should be), the next time I will run my app, the auth endpoint on B will be blocked with the curl error.... until I restart Unity.

Here is the auth call code.. but maybe the sequence is the problem... the weird thing is that only restarting Unity solves the problem... that supposes this is not due to some app persistence or memory allocation.

            currentRequest = new RequestHelper
            {
                Uri = API3DVerseService.uriAPI + "authentication/login",
                Body = new Account
                {
                    username = this.username,
                    password = this.password
                },
                Headers = new Dictionary<string, string> {
                    { "Content-Type", "application/json" },
                    { "User-Agent", "MyApp" }
                },
                EnableDebug = true

            };
            return RestClient.Post<Login3DVerseResponse>(currentRequest);

What can explain that? I suppose something is wrong in the whole process. I'm not a C# expert.. if you could help me..

@jdnichollsc
Copy link
Member

Can you attach your backend project to be able to reproduce this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants