Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fetch_async_get always return completed request #14

@S-S-X

Description

@S-S-X

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions