httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From TOKI...@aol.com
Subject Re: How to find scheme (http/https) in a module?
Date Sun, 05 Nov 2000 00:49:51 GMT

> In a message dated 00-11-03 14:34:57 EST, Vinod writes...
>
> What's the standard way (accross all SSL vendors) to find out in a apache 
> module if you are in a http/https mode?

Not sure if it's what you really want but if you simply
want to know what 'bound' port a request came in on
and whether it was one of the SSL ports then just check
the connection record for the request at any time.

Even if r->server->port is not 'accurate' yet you can still
make the same call yourself that sets the value from 
the r->connection record.

If you are on an internal redirect this info should still
reflect what 'bound' port the request originally came
in on ( secure vs. non-secure ).

There is no specific 'port' breakout value in the connection rec 
but it is easily obtained from either 'local_addr' or 'remote_addr'
connection record address struct(s).

See examples of a module accessing both 'local' and 'remote'
address parts of connection rec in the following module...

../modules/stndard/mod_dir.c

r->server->port=ntohs(r->connection->local_addr.sin_port);

There are other standard modules that have examples as
well such as '../modules/standard/mod_access.c'

Yours
Kevin Kiley
CTO, Remote Communications, Inc.

> Original message
> In a message dated 00-11-03 14:34:57 EST, Vinod writes...

> What's the standard way (accross all SSL vendors) to find out in a apache 
>  module
>  if you are in a http/https mode?
>  
>  I was assuming "request_rec->parsed_uri.scheme" to return me http/https, 
but
>  it returns NULL!
>  
>  Also looks like ap_table_get(r->subprocess_env,"HTTPS") is not a standard 
> way
>  to do it. At least it doesn't work with Raven.
>  
>  Thanks,
>  --Vinod 

Mime
View raw message