*sighs*
*sighs some more*
I hereby grant thee the right to SHOOT me next time I say "oh, let's write ed2k module first, its easy and I know the protocol".
Sure, yes, the protocol. Normally one would expect that a protocol is something that has been agreed upon to be used as common communication medium between two or more applications. What happens in ed2k network though is that EVERY client speaks a slang of the protocol. Sometimes only the words (e.g. packets) formats differ, but often, even the sentence structures (e.g. which order packets ar sent) differ. For example:
- Some clients send MuleInfo before HelloAnswer, some send it after.
- Some clients send requested chunks in the requested order, some send it in REVERSE order
- After completing 9500kb transfer session from client, some clients re-send AcceptUploadReq, some don't.
- After completing 9500kb tranfer session from client, some clients start sending old completed chunk, not next one from next part. (???)
These are only a few examples I'v encountered thus far. The result is I have to write workarounds and compensate for every such situation, which takes ages, and every such workaround opens up more holes in the entire system (since more things need to be checked), destabilizing the system every time I think I got it stable again. *pffft*
Here's the list of today's accomplishments
- New config option: HNShell port (requested by bedboi).
- Highlights important startup messages (e.g. where listeners started).
- Improved ClientSoftware and ClientVersion detection.
- Fixed PartData reloading.
- Used/Locked ranges are now properly unlocked/freed on DownloadInfo destruction
- MuleInfo packet is now (partially) processed (only used by old eMules)
- Safer downloading range locking mechanism, should avoid double-locking problems when processing AcceptUploadReq during odd times
- Add MetaData read from PartData reference file also to MetaDb.
- Save PartData right after starting download (not during first flushbuffer()).
- Made ED2KPacket::HashSet implementation exception-safe.
- More fixes and workarounds for the god-awful myriad of incompatible and broken ed2k clients. Will it ever end? :(
- Added API for starting downloads from text strings (e.g. links)
- It is now possible to start ed2k downloads via ed2k links by passing them to the "download" command in hnshell.
- Fixed chunkHash verification code in HashThread
All in all, it feels like I'm throwing tons and tons of fixes into the ed2k communication system, and nothing gets anywhere - like throwing fixes into an endless pit which never gets fixed. The most frustrating thing is that if the protocol was consistent over clients, I would'v been far done by now with ed2k module, but ... *sighs some more*
Madcat, ZzZz