static ssize_t
ngx_http_validate_host(u_char *host, size_t len)
{
    u_char      ch;
    size_t      i, last;
    ngx_uint_t  dot;
    last = len;
    dot = 0;
    for (i = 0; i < len; i++) {
        ch = host[i];
        if (ch == '.') {
            if (dot) {
                return -1;
            }
            dot = 1;
            continue;
        }
        dot = 0;
        if (ch == ':') {
            last = i;
            continue;
        }
        if (ch == '/' || ch == '\0') {
            return -1;
        }
#if (NGX_WIN32)
        if (ch == '\\') {
            return -1;
        }
#endif
    }
    if (dot) {
        last--;
    }
    return last;
}
["static ssize_t\nngx_http_validate_host(u_char *host, size_t len)\n{\n    u_char      ch;\n    size_t      i, last;\n    ngx_uint_t  dot;\n    last = len;\n    dot = 0;\n    for (i = 0; i < len; i++) {\n        ch = host[i];\n        if (ch == '.') {\n            if (dot) {\n                return -1;\n            }\n            dot = 1;\n            continue;\n        }\n        dot = 0;\n        if (ch == ':') {\n            last = i;\n            continue;\n        }\n        if (ch == '/' || ch == '\\0') {\n            return -1;\n        }\n#if (NGX_WIN32)\n        if (ch == '\\\\') {\n            return -1;\n        }\n#endif\n    }\n    if (dot) {\n        last--;\n    }\n    return last;\n}"]