httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Khimenko Victor" <apache-de...@khim.sch57.msk.ru>
Subject Re: Apache open PR summary for Sat Jul 24 03:06:00 PDT 1999
Date Sat, 24 Jul 1999 15:16:03 GMT
24-Jul-99 06:25 you wrote:
>> 3787 general  open     SERVER_PORT is always 80 if client comes to any port
>> and doesn't send 'Host:'


BJ> Interesting...

BJ> Does this imply it could be fixed???

BJ> (Just a dumb question, I suppose...)

Of course it can be fixed. What's more interesting is who, when and why added
code to generate this error ?

-- cut --
API_EXPORT(unsigned) ap_get_server_port(const request_rec *r)
{
    unsigned port;
    core_dir_config *d =
      (core_dir_config *)ap_get_module_config(r->per_dir_config, &core_module);

    port = r->server->port ? r->server->port : ap_default_port(r);

    if (d->use_canonical_name & 1) {
        return port;
    }
    return r->hostname ? ntohs(r->connection->local_addr.sin_port)
                       : port;
}
-- cut --

r->connection->local_addr.sin_port is always set to correct port (the one used
for connection, not one specified in `Host:'). Still it's used only when `Host:'
is specified ! Why ? What for ? Just to get PR 3787 ?




Mime
View raw message