Пример #1
0
static ngx_int_t
ngx_http_tfs_check_init_worker(ngx_cycle_t *cycle)
{
    ngx_uint_t                 i;
    ngx_http_tfs_upstream_t  **tup;
    ngx_http_tfs_main_conf_t  *tmcf;

    /* rc keepalive */
    tmcf = ngx_http_cycle_get_module_main_conf(cycle, ngx_http_tfs_module);
    if (tmcf == NULL) {
        return NGX_ERROR;
    }

    tup = tmcf->upstreams.elts;

    for (i = 0; i < tmcf->upstreams.nelts; i++) {
        if (!tup[i]->enable_rcs
            || !tup[i]->lock_file.len
            || !tup[i]->used)
        {
            return NGX_OK;
        }

        if (ngx_http_tfs_add_rcs_timers(cycle, tup[i]->timer_data) == NGX_ERROR)
        {
            return NGX_ERROR;
        }
    }

    return NGX_OK;
}
Пример #2
0
static ngx_int_t
ngx_http_tfs_check_init_worker(ngx_cycle_t *cycle)
{
    ngx_http_tfs_main_conf_t       *tmcf;
    /* rc keepalive */
    tmcf = ngx_http_cycle_get_module_main_conf(cycle, ngx_http_tfs_module);
    if (tmcf == NULL) {
        return NGX_ERROR;
    }

    if (tmcf->enable_rcs == NGX_HTTP_TFS_NO) {
        return NGX_OK;
    }

    if (tmcf->rcs_kp_enable) {
        return ngx_http_tfs_add_rcs_timers(cycle, tmcf);
    }

    return NGX_OK;
}