multitheftauto / mtasa-blue

Multi Theft Auto is a game engine that incorporates an extendable network play element into a proprietary commercial single-player game.
https://multitheftauto.com
GNU General Public License v3.0
1.38k stars 424 forks source link

HTTP server cannot handle binary files with a space in filename #1466

Closed Dutchman101 closed 2 months ago

Dutchman101 commented 4 years ago

Describe the bug Servers that use built-in HTTP server, can't use binary files with a space in filename within any resource, as it will generate HTTP download errors like the below one: SD23 1013,HTTP server file mismatch (weaponsounds) combat shotgun.aac [Got size:55 MD5:8D90FFA9DF5843E27FB4BCEFC1253555, wanted MD5:B0A60ED5D7772654C2E7DCE4E95324CE]

The malformed file with a size of 55 contains only this data (cleartext, when opened with Notepad): That resource file could not be found in that resource.

This happens even though the file is properly declared in meta.xml (including the space), the actual filename and directory matches exactly, and the script itself is properly attempting to use it. Renaming the file (in my example, from combat shotgun.aac to combat_shotgun.aac) immediately resolves the problem.

There are many reasons for resource download errors and I just isolated one (The type described in this issue).

Naturally, scripts that try to use binary files malformed to this 55 bytes cleartext file that this issue turns them into, can fail while executing the function trying to use said file (because it's no longer a valid file for that format).

Version Server 1.6 Client 1.6

Dutchman101 commented 3 years ago

I confirmed that external HTTP servers aren't affected.. it's an issue with our internal HTTP server. Servers that use the built-in HTTP to serve resources to client.

Dutchman101 commented 3 months ago

Bump, is there anyone interested in fixing this? Should be relatively easy to pinpoint

Dutchman101 commented 2 months ago

This has been recently fixed in server netcode, affected server owners can download the latest nightly.