예제 #1
0
파일: string.c 프로젝트: matsumoto-r/h2o
int h2o__lcstris_core(const char *target, const char *test, size_t test_len)
{
    for (; test_len != 0; --test_len)
        if (h2o_tolower(*target++) != *test++)
            return 0;
    return 1;
}
예제 #2
0
파일: config.c 프로젝트: Gwill/h2o
h2o_host_configuration_t *h2o_config_register_virtual_host(h2o_global_configuration_t *config, const char *hostname)
{
    h2o_host_configuration_t *host_config = h2o_malloc(sizeof(*host_config));
    size_t i;

    memset(host_config, 0, sizeof(*host_config));
    init_host_config(host_config);
    host_config->hostname = h2o_strdup(NULL, hostname, SIZE_MAX);
    for (i = 0; i != host_config->hostname.len; ++i)
        host_config->hostname.base[i] = h2o_tolower(host_config->hostname.base[i]);

    h2o_linklist_insert(&config->virtual_hosts, &host_config->_link);

    return host_config;
}