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

HTTPRequest fails to download files > 2.1GB #56314

Closed
Lyaaaaaaaaaaaaaaa opened this issue Dec 29, 2021 · 0 comments · Fixed by #56331
Closed

HTTPRequest fails to download files > 2.1GB #56314

Lyaaaaaaaaaaaaaaa opened this issue Dec 29, 2021 · 0 comments · Fixed by #56331

Comments

@Lyaaaaaaaaaaaaaaa
Copy link

Godot version

3.4.1 stable

System information

Windows 10, Pop_OS_21

Issue description

When you try to download a file > 2.1GB it returns

E 0:00:01.826   to_int: Cannot represent 3096617152 as integer, provided value is too big.
  <Erreur C++>  Condition "overflow" is true. Returned: sign == 1 ? (2147483647) : (-2147483647-1)
  <Source C++>  core/ustring.cpp:1828 @ to_int()

E 0:00:03.111   to_int: Cannot represent 3096617152 as integer, provided value is too big.
  <Erreur C++>  Condition "overflow" is true. Returned: sign == 1 ? (2147483647) : (-2147483647-1)
  <Source C++>  core/ustring.cpp:1828 @ to_int()

And the download will end at 2.1GB. An int seems to be used to store the file's size but the size is too big.
I had the same problem to display the size because it was too big, but solved it by using float. Not sure if this "fix" can be used in this case.

Steps to reproduce

This sample is enough to trigger the error. Or you can use the reproduction project.

    var url = "https://huggingface.co/microsoft/DialoGPT-large/resolve/main/tf_model.h5"
    var ssl = false
    var headers = []

    var error = $HTTPRequest.request(url, headers, ssl, HTTPClient.METHOD_GET)

    if error == OK:
        print("download started")
    elif error == ERR_INVALID_PARAMETER:
        print("Given string isn't a valid url ")
    elif error == ERR_CANT_CONNECT:
        print("Can't connect to host")

Minimal reproduction project

httprequest.zip

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

Successfully merging a pull request may close this issue.

4 participants