tonight I tried to download a tileset via ftp in the lobby of a game Jammyjamjamman was hosting.
After a few % progress I was disconnected from Jammy without an error-message.
I joined again Jammys game (was accepting players). This time I tried to download prax-Faction from him. Again after a download-progress from about 5% I was disconnected from his hosted lobby.
Getting disconnected during a download is an effect which can be observed when the upload bandwidth of the server is remarkably lower than the download bandwidth of all simultaneously receiving clients, especially (but not exclusively) when coupled with an unreliable link between (some of) these endpoints. What I assume happens there is that the hosting party's line is so busy with the upload that it fails to properly keep the gameserver connection(s) alive, so the client(s) gets disconnected and, as a result, the mod transfer stops, too. This effect can be much worse when you have multiple clients downloading at the same time.
I guess the best solution would be to have the game server bandwidth limit download speed for each direct file transfer to:
(lines' total available egress bandwidth) / (amount of downloading clients) - 10 kbps
The lines' total available egress bandwidth should be configurable on the options screen on the network tab, stored in the INI.
Sadly bandwidth limiting can be difficult to implement on an application layer. However, I think the clients use libcurl for the file transfers, and there's a chance that curl supports this feature already (CURLOPT_MAX_RECV_SPEED_LARGE and CURLOPT_BUFFERSIZE seem to be the relevant curl options - there's a chance these already work as environment parameters on the clients).
Even when this is not implemented, there are additional counter measures. One of the "under the hood" changes in 3.8.1 beta1 is that clients will try to receive file downloads from the location stored on the game mods server instead of receiving it from the game server. This only works if the file the client is missing is available there (checksum match). Since Prax has not been released, yet, and Atze has not yet requested for his mod to be added to the mod menu, there can be no such download on the mod servers, yet. But it does work fine for other mods which are already listed on the mod menu.
Another option is to have clients download one by one (obviously this requires human intervention and even then it would not have worked in the very case discussed here since a single download exceeded the hosting parties' upload bandwidth - which is not an uncommon scenario since most home users have asymmetric bandwidth setups where upload < download bandwidth).
The final option, which, until bandwidth throttling is implemented / known to work, is to disable file uploads on hosts with limited upload bandwidth. This is something Jammy could setup for his host. This obviously means he won't be able to share his files with others just by hosting a game of MegaGlest (but would have to resort to manual upload, and the client to manual download), but then it's just a workaround.
I connected again without restart MG an tried to cancel the offered download via FTP from Jammy. wasnt possible: again and again the download offer appeared.
This one, for sure, is not a bug but works as designed. In the past a download prompt would only display once. If the client decided not to download it, and the host did not switch to a different mod and started the game, then the client was still lacking the mod and the game would start up but the client lacking the file would get disconnected right after the game started. Not a great situation.
So this was changed so that as long as the host doesn't configure a different mod, the download prompts do show up on the client repetitively. The client may cancel the download prompt, but as long as the host does not change to a different mod (knowing that the client doesn't have it, which is displayed i his/her console), the client will receive another download prompt a few seconds later. This way it's now much more unlikely that clients will get disconnected as soon as the game starts because they did not download a mod.