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

fetch_async_get always return completed request #14

Open
4 tasks
S-S-X opened this issue Mar 26, 2021 · 0 comments
Open
4 tasks

fetch_async_get always return completed request #14

S-S-X opened this issue Mar 26, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@S-S-X
Copy link
Owner

S-S-X commented Mar 26, 2021

Possible bug.

  • Verify MT engine behavior with completely invalid requests.
    • Engine responds with HTTPRequestResult definition then fix code.
    • Engine responds with nil or false then fix code by replacing error with static return value.
    • Engine responds with crash then close this issue without fixing code.

If queue was full when adding request through fetch_async handle will be nil and error is thrown from fetch_async_get if called with invalid handle.

Possible fix (after actual behavior is verified)

Instead of returning invalid handle and throwing error on fetch_async_get it should return handle that looks fine but is well known marker for invalid requests that were canceled because queues were full already.

This can be easily done by returning 0 as handle and treating 0 as special marker for requests that does not exist at all.

If fetch_async_get is called with 0 as handle then it should return completed request with succeeded = false, timeout = false.
Most correct way to fill data and status would be to keep those empty if mt engine also does this for completely invalid requests.

@S-S-X S-S-X added the bug Something isn't working label Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant