Been pretty active development during last ~36 hours; here's the annotated list of changes.
- Fixed couple of race conditions in networking scheduler that happened due to underlying socket destruction being a delayed process, so events could still arrive while we had deleted all frontend data, which caused crashes / assertion failures.
- eDonkey2000 parser is now safer, and does more strict protocol / data checking. As it turned out, it was possible to send malicious data that caused Hydranode to attempt to allocate 4gb of memory (and get killed by the OS kernel as a result).
- Recusive usage of WorkThread::Pauser object works properly now, the thread is resumed when last Pauser is destroyed. This shold speed up startup times when hashing is requested during startup process, since hashing is now properly delayed until startup has finished.
- Faster disk space allocation on Windows.
- Added 'alloc' command to hnsh which can be used to explicitly request disk space allocation for a download (which hasn't auto-allocated space for itself yet).
- Fixed crashes when search result handler objects are destroyed (e.g. closing hnsh or disconnecting UI during global searching).
- Properly updates file's modification date in MetaDb after move to incoming is finished. No idea how this got missed before, but it was causing a lot of needless rehashing and duplicate entries in metadb.
- It's now possible to pass full paths to files (e.g. .torrents and such) to hlink application - as it turned out I had to double-escape all backslashes, so the resulting code looked like this: boost::algorithm::replace(string, "\\", "\\\\\\\\"). Fun eh? :)
- TCP server source requests are now split into 15-file chunks, ordered by rarity (rarest first), and sent with 4-minute intervals (up to a maximum of 75 files per 20 minutes). This is required by eDonkey2000 netiquette, and keeps your server credits reasonable; furthermore, servers don't respond to more than 15 source requests at a time in any case, so this considerably improves source aquisition from local server.
- UDP server source requests are now done based on file's rarity, the rarest 20-30 files are asked, rather than random rotation. This improves UDP queries usefullness, since it considerably raises the chances of getting few sources for file(s) we don't have any sources for, and then SourceExchange can kick in.
- Handles tracker responses that use \n newline instead of the standard \r\n.
- Closed/fixed bugtracker tickets 188, 228, 196, 229, 199, 213 235 and 215.
- CGComm listener can now be bound to custom ip address, just like hnsh. Configuration value /cgcomm/ListenIp, argument dot-separated ip address.
- Added experimental code for 'known torrent db' handling - namely, until now if the downloaded torrent contained subdirs, after restart we "lost" those files, since those directories were not shared. This torrentdb thingie scans those directories and loads the shared files from there during module init. It's not as robust as I'd like yet, so it'll most likely see a second incarnation soon, but for now it'll do.
- Cleans up torrent cache folder on download completition and download canceling.
- PartialTorrent and TorrentFile objects reparent their children to null when being destroyed, since they don't actually own their children, but the Object hierarhy logic dictates otherwise. This fixes a bunch of crashes during torrent completition/canceling.
- PartialTorrent and TorrentFile properly emit PD_ADDED and SF_ADDED events, respectivly, when constructed.
- HTTP module properly urlencodes requested file names.
The user interface has gotten several improvements as well. The biggest and most time-consuming was link/file associations. After patching QT library in order to access HKEY_CLASSES_ROOT section of the registry using QSettings API and thus avoid writing low-level win32 code, there are now two checkboxes in settings page which associate hlink (the link forwarder app) with ed2k and torrent links/files. No idea yet how to do the same on Linux, since there's no standard way of doing it there.
Madcat, ZzZz