httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf S. Engelschall" <>
Subject HINTS PLEASE: how to determine named-based vhost
Date Wed, 16 Sep 1998 10:34:42 GMT

A poked around in our http_vhost.c source but couldn't find an API function
which can be used. The problem is this: SSL interfaces like mod_ssl and
Apache-SSL should check whether the configured SSL-vhost is name-based or not.
Because fo SSL it _has_ to be IP-based. So, what's basically needed (and it
would be fine when we could add it for 1.3.2 and not patch it into the code
for mod_ssl, Apache-SSL, etc.) is

     int ap_is_name_based_vhost(server_rec *s);

As it looks it has to search "s" inside the iphash_table from http_vhost and
when it is found it has to look for the "names" attribute.
In other words:

     API_EXPORT int ap_is_name_based_vhost(server_rec *s)
         ipaddr_chain *ic;
         int rc = 0;
         int i;

         for (i = 0; i < IPHASH_TABLE_SIZE; i++) {
             for (ic = iphash_table[i]; ic != NULL; ic = ic->next) {
                 if (ic->server == s) {
                     if (ic->names == NULL)
                         rc = 1;
         return rc;

Is this correct and if yes, is it ok to be added to httpd_vhost.c? Dean?

                                       Ralf S. Engelschall

View raw message