While I haven't yet gotten confirmation that the completition-crash bug was actually fixed, we did discover that my last night's fix in EventTable pending events queue handling had larger impact than originally intended. Namely, it was using vector; handleEvents() was iterating on it using iterators, and postEvent() was push_back()'ing. However, as it turns out, ALL iterators to vectors (may be) invalidated upon call to push_back(). So, now that it's using deque, and safer iteration (using size() + pop_front()), it's way better.
Today I wasn't really even sure what to do next, so I just did some bughunting and general fixes. The list:
- Break out of merge-loop after merge to avoid merging with multiple clients. [was causing us to drop tons and tons of sources for past cpl days]
- Delay next UDP reask 10 minutes if previous fails. [The logic is that we fall back to TCP as last resort, and that's T0+50min, thus we do UDP reasks at 30, 40 and 50 mins, and if all those fail, fall back to TCP, because at T0+60min, eMule drops us from queue.]
- Silently ignore Client::establishConnection() calls if we are already trying to connect.
- Experimental support for ChangeId packet. [readonly]
- Dont try to send UDP source querys when theres no files to query for. [thnx xaignar for pointing this out]
- Clients which send us ReaskFilePing, but are not in our queue are now passivly added to queue.
- Only send OfferFiles (after conecting to server) if we actually have anything to offer. [thnx xaignar for pointing this out]
- Reset uploadInfo also when connection is lost. [was causing unhandled exceptions during UDP reasks occasionally]
- Dont send ReaskAck to clients which are already uploading. [was causing unhandled exceptions]
After this, I had also figured out where to go next - namely we need GlobGetServStat and GlobGetServDesc, because these will allow us to determine whether or not servers are alive, and thus start deleting servers from our list. The problem is, currently, if you have used hydranode for a while, you have a ton of dead servers in your list, and GlobGetSources effectivness drops to like 5% response, while it could be much higher - another hydranode with slightly newer serverlist already has 25% respones, so I figure, with proper server-clearing, we can get it up to 50-60% effectivness. Naturally, all of this will be mostly nullified as soon as we bring in kademlia, but it doesn't matter - searching for sources should be effective whether or not we have some new fancy network backend or not.
Madcat, ZzZz