Project

General

Profile

Actions

Bug #2439

closed

(connection config) "host:port" should not work

Added by chaosinux over 12 years ago. Updated over 11 years ago.

Status:
Invalid
Priority:
Normal
Category:
core
Target version:
-
ASK QUESTIONS IN Forums:

Description

This bug has been reported in Bug #2135.

File configfile-glue.c, function config_check_cond_nocache() in line 298-322:

switch(dc->cond) {
case CONFIG_COND_NE:
case CONFIG_COND_EQ:
        ck_colon = strchr(dc->string->ptr, ':');
        val_colon = strchr(l->ptr, ':');

        if (ck_colon == val_colon) {         /* This is true only when ck_colon == val_colon == NULL */
                /* nothing to do with it */
                break;
        }
        if (ck_colon) {
            /* condition "host:port" but client send "host" */
            buffer_copy_string_buffer(srv->cond_check_buf, l);
            buffer_append_string_len(srv->cond_check_buf, CONST_STR_LEN(":"));
            buffer_append_long(srv->cond_check_buf, sock_addr_get_port(&(srv_sock->addr)));
            l = srv->cond_check_buf;
        } else if (!ck_colon) {
            /* condition "host" but client send "host:port" */
            buffer_copy_string_len(srv->cond_check_buf, l->ptr, val_colon - l->ptr);
            l = srv->cond_check_buf;
        }
        break;
default:
    break;
}

Line 304 if (ck_colon == val_colon) will not be true if both
condition "host:port" and client "host:port".

However, when I test with the following conditional configuration, it works!

$SERVER["socket"] == "127.0.0.1:8080" {
    server.document-root    = "/srv/http/file" 
    dir-listing.activate    = "enable" 
}

While dir-listing.activate is "disable" in global.
When I connect to "127.0.0.1:8080", dir-listing works fine, don't no why!


Related issues 1 (0 open1 closed)

Related to Bug #2135: $HTTP["host"] == "hostname:port" works wrongFixed2009-12-31Actions
Actions #1

Updated by stbuehler about 12 years ago

  • Status changed from New to Invalid

socket conditional is special (it opens a socket on the specified port, and doesn't do any string comparisons).

the first bug is already reported, the second "thing" is not a bug.

Actions #2

Updated by stbuehler over 11 years ago

  • Target version deleted (1.4.x)
Actions

Also available in: Atom