Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This changes callback handling when headers and data are received. Before this pr if you register data or headers callbacks, they wont work as expected, and would fire when RequestCompleted callback is triggered, and in most cases headers and data callbacks got incorrect parameters (not sure if it ever worked, for me it was always incorrect) as it was propagated by HTTPRequestCompleted_t struct and not the others.
This pr changes the callbacks to be global ones, which do work in this instance, but they require manually filtering which request it's called for. Thus there were multiple options for me to take, one is store all the ongoing requests in a list and have one global callback instance to filter there all the requests and fire appropriate forwards. Second as how I did it here, I'm instantiating a new callbacks each time you create a new request, but I do filter them by checking the request handle as it's conveniently provided in the resulting structures. This tho does comes with its downside as it's basically would mean that for each new request other callbacks would be called the same amount of times as there are requests active (yet they would do nothing), not sure if it's anything crucial performance wise.
I also would like to hear your opinion on that matter as well.