-
Notifications
You must be signed in to change notification settings - Fork 512
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
Sokol Fetch Http response 200 is reported as an error #1062
Comments
Agreed, only checking for status code 200 is too narrow, however: I suspect the problematic code is this: Lines 2225 to 2239 in c54523c
...since the other location where Lines 2200 to 2207 in c54523c
...it might be about the Are you trying to stream data in chunks? E.g. I'd like to know more about the situation first. Are you able to reproduce the problem on your side and could check the Network tab in the browser what the requests and responses are going back and forth? If yes can you paste those here? |
Hmm ok, the callstack confirms that it's coming out of this function: Lines 2213 to 2242 in c54523c
...and it looks like it is related to 'range requests' (e.g. not reading the entire file at once, but in smaller chunks). I seem to remember what's up: When sending a range-request to only read part of the data, I'm expecting that a A couple of questions:
Can you try to simply not set the the chunk-size to anything? E.g. just keep it zero-initialized or set it explicitly to zero (I realize though that ...also, regardless of whether it's an actual sokol_fetch.h bug or not, I should at least do something about the confusing error that's reported when a chunk_size is set but the server doesn't return with a 206 status code. |
PS: can you paste your |
Just changed it so the chunk_size was explicitly zero and it fixed the problem.
the buffer size was 10MB (aka the file was 1.8kb Just for future reference, does the chunk size mean: 'only load x amount of data from a file'? I interpreted it to be the 'limit' of how many bytes it could read per |
Yeah I agree that the I'll keep the ticket open because I should at least do something about the issue, and if it's just improving the documentation, or communicate a better error. Regardless, thanks for the ticket and making me aware of the issue! |
thanks for the help, it's a great library! |
Got errors flagged on the callback despite double checking and I have recieved a http success reponse code of 200.
and my debug print from sokol_fetch says its 200 so it should be g but it isn't for some reason?
It seems like an easy change to just add a check to see if the http_status is between 200-209 and not report it as an error? I could do that?
The text was updated successfully, but these errors were encountered: