static ngx_int_t
ngx_parse_unix_domain_url(ngx_pool_t *pool, ngx_url_t *u)
{
#if (NGX_HAVE_UNIX_DOMAIN)
    u_char              *path, *uri, *last;
    size_t               len;
    struct sockaddr_un  *saun;
    len = u->url.len;
    path = u->url.data;
    path += 5;
    len -= 5;
    if (u->uri_part) {
        last = path + len;
        uri = ngx_strlchr(path, last, ':');
        if (uri) {
            len = uri - path;
            uri++;
            u->uri.len = last - uri;
            u->uri.data = uri;
        }
    }
    if (len == 0) {
        u->err = "no path in the unix domain socket";
        return NGX_ERROR;
    }
    u->host.len = len++;
    u->host.data = path;
    if (len > sizeof(saun->sun_path)) {
        u->err = "too long path in the unix domain socket";
        return NGX_ERROR;
    }
    u->socklen = sizeof(struct sockaddr_un);
    saun = (struct sockaddr_un *) &u->sockaddr;
    saun->sun_family = AF_UNIX;
    (void) ngx_cpystrn((u_char *) saun->sun_path, path, len);
    u->addrs = ngx_pcalloc(pool, sizeof(ngx_peer_addr_t));
    if (u->addrs == NULL) {
        return NGX_ERROR;
    }
    saun = ngx_pcalloc(pool, sizeof(struct sockaddr_un));
    if (saun == NULL) {
        return NGX_ERROR;
    }
    u->family = AF_UNIX;
    u->naddrs = 1;
    saun->sun_family = AF_UNIX;
    (void) ngx_cpystrn((u_char *) saun->sun_path, path, len);
    u->addrs[0].sockaddr = (struct sockaddr *) saun;
    u->addrs[0].socklen = sizeof(struct sockaddr_un);
    u->addrs[0].name.len = len + 4;
    u->addrs[0].name.data = u->url.data;
    return NGX_OK;
#else
    u->err = "the unix domain sockets are not supported on this platform";
    return NGX_ERROR;
#endif
}
['static ngx_int_t\nngx_http_fastcgi_eval(ngx_http_request_t *r, ngx_http_fastcgi_loc_conf_t *flcf)\n{\n    ngx_url_t  u;\n    ngx_memzero(&u, sizeof(ngx_url_t));\n    if (ngx_http_script_run(r, &u.url, flcf->fastcgi_lengths->elts, 0,\n                            flcf->fastcgi_values->elts)\n        == NULL)\n    {\n        return NGX_ERROR;\n    }\n    u.no_resolve = 1;\n    if (ngx_parse_url(r->pool, &u) != NGX_OK) {\n         if (u.err) {\n            ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,\n                          "%s in upstream \\"%V\\"", u.err, &u.url);\n        }\n        return NGX_ERROR;\n    }\n    if (u.no_port) {\n        ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,\n                      "no port in upstream \\"%V\\"", &u.url);\n        return NGX_ERROR;\n    }\n    r->upstream->resolved = ngx_pcalloc(r->pool,\n                                        sizeof(ngx_http_upstream_resolved_t));\n    if (r->upstream->resolved == NULL) {\n        return NGX_ERROR;\n    }\n    if (u.addrs && u.addrs[0].sockaddr) {\n        r->upstream->resolved->sockaddr = u.addrs[0].sockaddr;\n        r->upstream->resolved->socklen = u.addrs[0].socklen;\n        r->upstream->resolved->naddrs = 1;\n        r->upstream->resolved->host = u.addrs[0].name;\n    } else {\n        r->upstream->resolved->host = u.host;\n        r->upstream->resolved->port = u.port;\n    }\n    return NGX_OK;\n}', 'u_char *\nngx_http_script_run(ngx_http_request_t *r, ngx_str_t *value,\n    void *code_lengths, size_t len, void *code_values)\n{\n    ngx_uint_t                    i;\n    ngx_http_script_code_pt       code;\n    ngx_http_script_len_code_pt   lcode;\n    ngx_http_script_engine_t      e;\n    ngx_http_core_main_conf_t    *cmcf;\n    cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);\n    for (i = 0; i < cmcf->variables.nelts; i++) {\n        if (r->variables[i].no_cacheable) {\n            r->variables[i].valid = 0;\n            r->variables[i].not_found = 0;\n        }\n    }\n    ngx_memzero(&e, sizeof(ngx_http_script_engine_t));\n    e.ip = code_lengths;\n    e.request = r;\n    e.flushed = 1;\n    while (*(uintptr_t *) e.ip) {\n        lcode = *(ngx_http_script_len_code_pt *) e.ip;\n        len += lcode(&e);\n    }\n    value->len = len;\n    value->data = ngx_pnalloc(r->pool, len);\n    if (value->data == NULL) {\n        return NULL;\n    }\n    e.ip = code_values;\n    e.pos = value->data;\n    while (*(uintptr_t *) e.ip) {\n        code = *(ngx_http_script_code_pt *) e.ip;\n        code((ngx_http_script_engine_t *) &e);\n    }\n    return e.pos;\n}', 'ngx_int_t\nngx_parse_url(ngx_pool_t *pool, ngx_url_t *u)\n{\n    u_char  *p;\n    p = u->url.data;\n    if (ngx_strncasecmp(p, (u_char *) "unix:", 5) == 0) {\n        return ngx_parse_unix_domain_url(pool, u);\n    }\n    if ((p[0] == \':\' || p[0] == \'/\') && !u->listen) {\n        u->err = "invalid host";\n        return NGX_ERROR;\n    }\n    if (p[0] == \'[\') {\n        return ngx_parse_inet6_url(pool, u);\n    }\n    return ngx_parse_inet_url(pool, u);\n}', 'static ngx_int_t\nngx_parse_unix_domain_url(ngx_pool_t *pool, ngx_url_t *u)\n{\n#if (NGX_HAVE_UNIX_DOMAIN)\n    u_char              *path, *uri, *last;\n    size_t               len;\n    struct sockaddr_un  *saun;\n    len = u->url.len;\n    path = u->url.data;\n    path += 5;\n    len -= 5;\n    if (u->uri_part) {\n        last = path + len;\n        uri = ngx_strlchr(path, last, \':\');\n        if (uri) {\n            len = uri - path;\n            uri++;\n            u->uri.len = last - uri;\n            u->uri.data = uri;\n        }\n    }\n    if (len == 0) {\n        u->err = "no path in the unix domain socket";\n        return NGX_ERROR;\n    }\n    u->host.len = len++;\n    u->host.data = path;\n    if (len > sizeof(saun->sun_path)) {\n        u->err = "too long path in the unix domain socket";\n        return NGX_ERROR;\n    }\n    u->socklen = sizeof(struct sockaddr_un);\n    saun = (struct sockaddr_un *) &u->sockaddr;\n    saun->sun_family = AF_UNIX;\n    (void) ngx_cpystrn((u_char *) saun->sun_path, path, len);\n    u->addrs = ngx_pcalloc(pool, sizeof(ngx_peer_addr_t));\n    if (u->addrs == NULL) {\n        return NGX_ERROR;\n    }\n    saun = ngx_pcalloc(pool, sizeof(struct sockaddr_un));\n    if (saun == NULL) {\n        return NGX_ERROR;\n    }\n    u->family = AF_UNIX;\n    u->naddrs = 1;\n    saun->sun_family = AF_UNIX;\n    (void) ngx_cpystrn((u_char *) saun->sun_path, path, len);\n    u->addrs[0].sockaddr = (struct sockaddr *) saun;\n    u->addrs[0].socklen = sizeof(struct sockaddr_un);\n    u->addrs[0].name.len = len + 4;\n    u->addrs[0].name.data = u->url.data;\n    return NGX_OK;\n#else\n    u->err = "the unix domain sockets are not supported on this platform";\n    return NGX_ERROR;\n#endif\n}']