httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 45405] Allow binding port to be set for individual workers for proxy requests
Date Fri, 18 Jul 2008 19:24:00 GMT

--- Comment #7 from D. Stussy <>  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

I chose not to invalidate the previous updated patch as I have NOT tested my
suggestion with corrections above applied.

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message