Open djkaty opened 9 years ago
You are right if the initial list has more than one entry and the first address failed it will increment _CurrentAddress but Connect() assumes the list length hasnt changed. It should reset the incrementor if the list has changed from the initial list. The recursion also buggers me, if a server isnt available for a long time it will crash with a stack overflow. This happened in Smuxi already.
I'll fix it in this branch. I've already merged a few code paths where threads are unnecessarily closing things that were already half-centralized in Disconnect(). It's a nightmare to abstract.
I'll fix the recursion as well.
Both these issues are now fixed in my codebase. PR soon.
There was also a bug in the AutoRetry code (condition of how many attempts had been made was using >= instead of <, causing it to never make more than one attempt), which is also fixed.
I haven't checked this, but if I'm reading the code in IrcConnection.cs properly, is there not potential for an IndexOutOfBoundsException under the following circumstances:
_NextAddress() is never called / _CurrentAddress is never reset to 0 at the beginning of a new connection attempt, I think? Could someone confirm this?