wolkykim / qlibc

qLibc is a simple and yet powerful C library providing generic data structures and algorithms.

Home Page:http://wolkykim.github.io/qlibc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hostname or destname

winxxp opened this issue · comments

hostname or destname?????

qhttpclient_t *qhttpclient(const char *destname, int port) {
    bool ishttps = false;
    char hostname[256];
    if (port == 0 || strstr(hostname, "://") != NULL) { // hostname or destname?????
        if (_parse_uri(destname, &ishttps, hostname, sizeof(hostname), &port)
                == false) {
            DEBUG("Can't parse URI %s", destname);
            return NULL;
        }

        DEBUG("https: %d, hostname: %s, port:%d\n", ishttps, hostname, port);
    } else {
        qstrcpy(hostname, sizeof(hostname), destname);
    }

Thanks for the report. That appeared to be a bug. I've made a PR to address the issue. Thanks