Example #1
0
rstatus_t
proxy_each_init(void *elem, void *data)
{
    rstatus_t status;
    struct server_pool *pool = elem;
    struct conn *p;

    p = conn_get_proxy(pool);
    if (p == NULL) {
        return NC_ENOMEM;
    }

    status = proxy_listen(pool->ctx, p);
    if (status != NC_OK) {
        p->close(pool->ctx, p);
        return status;
    }

    log_debug(LOG_NOTICE, "p %d listening on '%.*s' in %s pool %"PRIu32" '%.*s'"
              " with %"PRIu32" servers", p->sd, pool->addrstr.len,
              pool->addrstr.data, pool->redis ? "redis" : "memcache",
              pool->idx, pool->name.len, pool->name.data,
              array_n(&pool->server));

    return NC_OK;
}
Example #2
0
rstatus_t
proxy_each_init(void *elem, void *data)
{
    rstatus_t status;
    struct server_pool *pool = elem;
    struct conn *p;

    p = conn_get_proxy(pool);
    if (p == NULL) {
        return DN_ENOMEM;
    }

    status = proxy_listen(pool->ctx, p);
    if (status != DN_OK) {
        p->close(pool->ctx, p);
        return status;
    }

    char * log_datastore = "not selected data store";
    if (pool->data_store == DATA_REDIS){
    	log_datastore = "redis";
    }
    else if (pool->data_store == DATA_MEMCACHE){
    	log_datastore = "memcache";
    }


    log_debug(LOG_NOTICE, "p %d listening on '%.*s' in %s pool %"PRIu32" '%.*s'"
              " with %"PRIu32" servers", p->sd, pool->addrstr.len,
              pool->addrstr.data,
			  log_datastore,
              pool->idx, pool->name.len, pool->name.data,
              array_n(&pool->server));

    return DN_OK;
}