https://issues.apache.org/bugzilla/show_bug.cgi?id=45405
--- Comment #7 from D. Stussy <[EMAIL PROTECTED]> 2008-07-18 12:23:59 PST --- I noted two problems: 1) Error: Change to how we parsed "range": By not bumping by one in the parser as we used to do, we caused a potential division by zero at the modulo division in bind_to_addr(). Revert condition in for-loop, bump by one in the parser, and adjust boundary tests, syslog warning, and set range = 1 where user omits it. 2) Performance issue -- Rotating across the port range on different calls to bind_to_addr(): As is, we seem to be starting each subsequent search for a port at the port after we started the last search. The adjustment I proposed starts the search at the port after where we ENDED the last search. There seemed little point re-checking FIRST ports we skipped last call, as opposed to checking ports that we might not have checked last time. If we had checked them all last time, it doesn't matter where we start. Also noted: Setting "idx" = "i + 1" doesn't necessarily rotate in the matter intended. It could also set "idx" == "range", but idx implicitly has a valuation range of 0...(range -1). As we use it with modulo arithmetic, we got lucky and properly handled exceeding the maximum value. I think this also meant that "idx" on calls after the first would NEVER be zero and therefore the first port might have been selected less often than the round-robin we intended. I chose not to invalidate the previous updated patch as I have NOT tested my suggestion with corrections above applied. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
