NCBI C++ ToolKit
Classes | Macros | Functions | Variables
ncbi_dispd.c File Reference
#include "ncbi_ansi_ext.h"
#include "ncbi_comm.h"
#include "ncbi_dispd.h"
#include "ncbi_lb.h"
#include "ncbi_priv.h"
#include <connect/ncbi_http_connector.h>
#include <ctype.h>
#include <stdlib.h>
+ Include dependency graph for ncbi_dispd.c:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

struct  SDISPD_Data
 

Macros

#define fabs(v)   ((v) < 0.0 ? -(v) : (v))
 
#define NCBI_USE_ERRCODE_X   Connect_LBSM
 
#define DISPD_STALE_RATIO_OK   0.8
 
#define DISPD_LOCAL_BONUS   1.2
 

Functions

static SSERV_Infos_GetNextInfo (SERV_ITER, HOST_INFO *)
 
static int s_Update (SERV_ITER, const char *, int)
 
static void s_Reset (SERV_ITER)
 
static void s_Close (SERV_ITER)
 
static int s_AddServerInfo (struct SDISPD_Data *data, SSERV_Info *info)
 
static EHTTP_HeaderParse s_ParseHeader (const char *header, void *user_data, int server_error)
 
static int s_Adjust (SConnNetInfo *net_info, void *iter, unsigned int unused)
 
static void s_Resolve (SERV_ITER iter)
 
static int s_IsUpdateNeeded (struct SDISPD_Data *data, TNCBI_Time now)
 
static SLB_Candidates_GetCandidate (void *user_data, size_t n)
 
const SSERV_VTableSERV_DISPD_Open (SERV_ITER iter, const SConnNetInfo *net_info, SSERV_Info **info)
 

Variables

static const SSERV_VTable kDispdOp
 

Macro Definition Documentation

◆ DISPD_LOCAL_BONUS

#define DISPD_LOCAL_BONUS   1.2

Definition at line 53 of file ncbi_dispd.c.

◆ DISPD_STALE_RATIO_OK

#define DISPD_STALE_RATIO_OK   0.8

Definition at line 51 of file ncbi_dispd.c.

◆ fabs

#define fabs (   v)    ((v) < 0.0 ? -(v) : (v))

◆ NCBI_USE_ERRCODE_X

#define NCBI_USE_ERRCODE_X   Connect_LBSM

Definition at line 48 of file ncbi_dispd.c.

Function Documentation

◆ s_AddServerInfo()

static int s_AddServerInfo ( struct SDISPD_Data data,
SSERV_Info info 
)
static

Definition at line 86 of file ncbi_dispd.c.

References data, free(), info, malloc(), n, SERV_EqualInfo(), SERV_NameOfInfo(), and strcasecmp.

Referenced by s_Update().

◆ s_Adjust()

static int s_Adjust ( SConnNetInfo net_info,
void *  iter,
unsigned int  unused 
)
static

Definition at line 155 of file ncbi_dispd.c.

References data.

Referenced by s_Resolve().

◆ s_Close()

static void s_Close ( SERV_ITER  iter)
static

Definition at line 381 of file ncbi_dispd.c.

References assert, ConnNetInfo_Destroy(), SSERV_IterTag::data, data, and free().

Referenced by SERV_DISPD_Open().

◆ s_GetCandidate()

static SLB_Candidate* s_GetCandidate ( void *  user_data,
size_t  n 
)
static

Definition at line 324 of file ncbi_dispd.c.

References data, and n.

Referenced by s_GetNextInfo().

◆ s_GetNextInfo()

static SSERV_Info * s_GetNextInfo ( SERV_ITER  iter,
HOST_INFO host_info 
)
static

◆ s_IsUpdateNeeded()

static int s_IsUpdateNeeded ( struct SDISPD_Data data,
TNCBI_Time  now 
)
static

Definition at line 299 of file ncbi_dispd.c.

References data, DISPD_STALE_RATIO_OK, fabs, free(), i, info, memmove, and SDISPD_Data::n_cand.

Referenced by s_GetNextInfo().

◆ s_ParseHeader()

static EHTTP_HeaderParse s_ParseHeader ( const char *  header,
void *  user_data,
int  server_error 
)
static

Definition at line 126 of file ncbi_dispd.c.

References SSERV_IterTag::data, data, eHTTP_HeaderError, eHTTP_HeaderSuccess, if(), and SERV_Update().

Referenced by s_Resolve().

◆ s_Reset()

static void s_Reset ( SERV_ITER  iter)
static

Definition at line 366 of file ncbi_dispd.c.

References assert, SSERV_IterTag::data, data, free(), i, if(), and SSERV_IterTag::n_skip.

Referenced by SERV_DISPD_Open().

◆ s_Resolve()

static void s_Resolve ( SERV_ITER  iter)
static

◆ s_Update()

static int s_Update ( SERV_ITER  iter,
const char *  text,
int  code 
)
static

◆ SERV_DISPD_Open()

const SSERV_VTable* SERV_DISPD_Open ( SERV_ITER  iter,
const SConnNetInfo net_info,
SSERV_Info **  info 
)

Variable Documentation

◆ kDispdOp

const SSERV_VTable kDispdOp
static
Initial value:
= {
}
static void s_Close(SERV_ITER)
Definition: ncbi_dispd.c:381
static void s_Reset(SERV_ITER)
Definition: ncbi_dispd.c:366
static SSERV_Info * s_GetNextInfo(SERV_ITER, HOST_INFO *)
Definition: ncbi_dispd.c:331
static int s_Update(SERV_ITER, const char *, int)
Definition: ncbi_dispd.c:224

Definition at line 65 of file ncbi_dispd.c.

Referenced by SERV_DISPD_Open().

Modified on Fri Sep 20 14:58:07 2024 by modify_doxy.py rev. 669887