75 ? realloc(data->
cand,
n *
sizeof(*data->
cand))
83 n = (size_t) rand() % ++data->
n_cand;
84 if (n < data->n_cand - 1) {
85 temp = data->
cand +
n++;
105 for (
n = 0;
n <= 100; ++
n) {
125 info->host = localhost;
127 &&
info->host != localhost) {
170 services,
sizeof(services), 0)) || !*c) {
176 for (s += strspn(s,
" \t"); *s; s += strspn(s,
" \t")) {
177 size_t len = strcspn(s,
" \t");
197 static int s_Sort(
const void* p1,
const void* p2)
226 int dns_info_seen = 0;
241 while (i < data->
n_cand) {
273 if (n < iter->n_skip) {
316 if (
i >= data->
n_cand && dns_info_seen)
328 }
else if (iter->
last || iter->
n_skip || !dns_info_seen) {
333 if (
info && host_info)
SSERV_Info * SERV_CreateDnsInfo(unsigned int host)
unsigned int TSERV_Type
Bitwise OR of ESERV_Type[Special].
int SERV_EqualInfo(const SSERV_Info *info1, const SSERV_Info *info2)
@ fSERV_Stateless
Stateless servers only.
unsigned int SOCK_GetLocalHostAddress(ESwitch reget)
Get (and cache for faster follow-up retrievals) IPv4 address of local host.
int UTIL_MatchesMask(const char *text, const char *mask)
Shortcut for UTIL_MatchesMaskEx(text, mask, 1), that is matching is done case-insensitively for the l...
const char * ConnNetInfo_GetValue(const char *service, const char *param, char *value, size_t value_size, const char *def_value)
#define NCBI_TIME_INFINITE
#define REG_CONN_LOCAL_SERVICES
#define REG_CONN_LOCAL_SERVER
unsigned int
A callback function used to compare two keys in a database.
if(yy_accept[yy_current_state])
const struct ncbi::grid::netcache::search::fields::KEY key
#define LBSM_DEFAULT_RATE
#define LBSM_DEFAULT_TIME
size_t LB_Select(SERV_ITER iter, void *data, FGetCandidate get_candidate, double bonus)
static const SSERV_VTable s_op
static void s_Close(SERV_ITER)
static SLB_Candidate * s_GetCandidate(void *user_data, size_t i)
static int s_LoadSingleService(const char *name, SERV_ITER iter)
static int s_LoadServices(SERV_ITER iter)
static void s_Reset(SERV_ITER)
const SSERV_VTable * SERV_LOCAL_Open(SERV_ITER iter, SSERV_Info **info)
static int s_AddService(const SSERV_Info *info, struct SLOCAL_Data *data)
static int s_Sort(const void *p1, const void *p2)
static SSERV_Info * s_GetNextInfo(SERV_ITER, HOST_INFO *)
unsigned int g_NCBI_ConnectRandomSeed
#define NCBI_CONNECT_SRAND_ADDEND
SSERV_Info * SERV_ReadInfoEx(const char *str, const char *name, int lazy)
const char * SERV_NameOfInfo(const SSERV_Info *info)
char * SERV_ServiceName(const char *service)
static const struct type types[]
voidp calloc(uInt items, uInt size)