httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 45405] Allow binding port to be set for individual workers for proxy requests
Date Tue, 22 Jul 2008 18:55:42 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=45405





--- Comment #10 from D. Stussy <apache+bugreports@kd6lvw.ampr.org>  2008-07-22 11:55:41
PST ---
I believe you missed a couple of points that I made in last suggested patch. 
These do not affect the outcome but do affect efficiency:

1)  Bind_to_addr() "const int range = bind->range + 1;":  This means that it
will have to add one for every try per address family to bind to a port in the
range.  I incremented the value in the parser because that is one exactly ONCE,
not once per attempt to bind.  It repeats a fixed operation over and over which
only need be done once forever (until reconfigured).

2)  Bind_to_addr() "bind->idx = idx + i + 1;":  Technically incorrect.  "idx"
is defined to have values 0...(range-1), and this code can set "idx" to equal
2*range-1 or MORE.  The only reason the code works is the modulo arithimetic on
line 2278.  Note that an optimizing compiler will realize that "idx" remains
equal to "bind->idx" and thus compile this as "bind->idx += i + 1;".  I still
think that this should be "bind->idx = (idx + i + 1) % range;" OR "bind->idx =
(port - start + 1) % range;" (same result but perhaps earier to comprehend for
someone not familiar with the code) to keep the variable inside our defined
limits for it.

3)  New point:  parse_bind_address().  Since we have a "struct
proxy_bind_addr", we don't need to pass by reference three structure elements. 
We could pass the address to the structure itself instead.  This also allows us
to set "bind->idx=0" in one place -- the parser, not two as we do now, and
should anything else call the parser in the future, then the value won't be
forgotten.


-- 
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: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message