Skip to content

Conversation

@carlonluca
Copy link
Contributor

The short_file value for some URLs may result in the string "/". For example, this URL:

http://te-home.net/?do=hublist&get=hublist.config.bz2

results in:

short_file: /
full_file: /?do=hublist&get=hublist.config.bz2

this makes it impossible to save the file. With this change, a random file name is chosen.

The short_file value for some URLs may result in the string "/". For
example, this URL:

http://te-home.net/?do=hublist&get=hublist.config.bz2

results in:

short_file: /
full_file: /?do=hublist&get=hublist.config.bz2

this makes it impossible to save the file. With this change, a random
file name is chosen.
Comment on lines 441 to 442
let prng = Random.State.make_self_init () in
let rnd = (Random.State.bits prng) land 0xFFFFFF in
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really strange why it just doesn't call Random.int
or even better - use mkstemps

@ygrek ygrek merged commit 0d44635 into ygrek:master Jan 28, 2025
13 of 15 checks passed
carlonluca referenced this pull request in carlonluca/mldonkey Jan 31, 2025
The short_file value for some URLs may result in the string "/". For
example, this URL:

http://te-home.net/?do=hublist&get=hublist.config.bz2

results in:

short_file: /
full_file: /?do=hublist&get=hublist.config.bz2

this makes it impossible to save the file. With this change, a random
file name is chosen.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants