httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <>
Subject Re: unsigned host port
Date Mon, 07 Apr 1997 05:50:22 GMT
On Sun, 6 Apr 1997, Alexei Kosut wrote:

> If a module compiled for an older version (1.2b7, say) that makes use
> of the port variable is linked into the current Apache, mightn't it be
> about 32678 off when it comes to the number of the port? In other
> words, I'm not sure if this is a change that is binary-compatible with
> object files from previous Apaches. And if it isn't, I we should
> change the API number.

I can think of right around 0 platforms that Apache runs on that don't use
either signed two's complement or some other method where the high bit is
used as a sign bit.

> Admittedly, I'm not sure this is really an issue. I seem to recall
> most C implementations using the highest bit of a value for sign, but

Isn't really a C issue (well... erm... it could be if you wanted your
stuff to be slower than MS's products...) but, for all practical purposes,
it depends on the hardware architecture.

> I don't remember whether that bits being on indicates positive or
> negative. If the latter, we probably get away with doing nothing. If
> the former, we should definitely do something.

High bit is set for a negative value.  For all values between 1 and 32768,
the lower 15 bits in a 16 bit representation should be the same.  

If an old module expected some particular behavior on a negative port it
will perhaps work differently, but that is certainly outside the bounds of
what the API defines.

View raw message