NCBI C++ ToolKit
|
#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>
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_Info * | s_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_Candidate * | s_GetCandidate (void *user_data, size_t n) |
const SSERV_VTable * | SERV_DISPD_Open (SERV_ITER iter, const SConnNetInfo *net_info, SSERV_Info **info) |
Variables | |
static const SSERV_VTable | kDispdOp |
#define DISPD_LOCAL_BONUS 1.2 |
Definition at line 53 of file ncbi_dispd.c.
#define DISPD_STALE_RATIO_OK 0.8 |
Definition at line 51 of file ncbi_dispd.c.
#define fabs | ( | v | ) | ((v) < 0.0 ? -(v) : (v)) |
Definition at line 46 of file ncbi_dispd.c.
#define NCBI_USE_ERRCODE_X Connect_LBSM |
Definition at line 48 of file ncbi_dispd.c.
|
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().
|
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().
|
static |
|
static |
Definition at line 331 of file ncbi_dispd.c.
References assert, SSERV_IterTag::data, data, DISPD_LOCAL_BONUS, if(), info, LB_Select(), memmove, n, SDISPD_Data::n_cand, SSERV_IterTag::n_skip, s_GetCandidate(), s_IsUpdateNeeded(), s_Resolve(), and SSERV_IterTag::time.
|
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().
|
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().
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().
Definition at line 164 of file ncbi_dispd.c.
References assert, conn, CONN_Close(), CONN_Create(), CONN_Flush(), ConnNetInfo_DeleteUserHeader(), ConnNetInfo_OverrideUserHeader(), ConnNetInfo_URL(), CORE_LOGF_X, SSERV_IterTag::data, data, eIO_Success, eIO_Unknown, eLOG_Error, fHTTP_Flushable, SConnNetInfo::firewall, free(), fSERV_Firewall, fSERV_Stateless, HTTP_CreateConnectorEx(), IO_StatusStr(), SSERV_IterTag::name, SDISPD_Data::net_info, SSERV_IterTag::ok_down, SSERV_IterTag::ok_suppressed, SSERV_IterTag::reverse_dns, s_Adjust(), s_ParseHeader(), SERV_Print(), SConnNetInfo::stateless, and SSERV_IterTag::types.
Referenced by s_GetNextInfo(), and SERV_DISPD_Open().
Definition at line 224 of file ncbi_dispd.c.
References assert, CORE_LOGF_X, SSERV_IterTag::data, data, eLOG_Note, eLOG_Warning, failure, free(), HTTP_DISP_FAILURES, HTTP_DISP_MESSAGES, if(), info, int, isdigit(), SSERV_IterTag::ismask, isspace(), SSERV_IterTag::name, NCBI_TIME_INFINITE, SSERV_IterTag::reverse_dns, s_AddServerInfo(), SERV_ReadInfoEx(), strdup, strncasecmp, text(), and SSERV_IterTag::time.
const SSERV_VTable* SERV_DISPD_Open | ( | SERV_ITER | iter, |
const SConnNetInfo * | net_info, | ||
SSERV_Info ** | info | ||
) |
Definition at line 397 of file ncbi_dispd.c.
References assert, calloc(), ConnNetInfo_Clone(), ConnNetInfo_ExtendUserHeader(), ConnNetInfo_SetupStandardArgs(), CORE_LOGF, SSERV_IterTag::data, data, eFWMode_Adaptive, eLOG_Trace, eReqMethod_Get, eURL_Https, fSERV_Firewall, fSERV_Stateless, g_NCBI_ConnectRandomSeed, info, kDispdOp, SSERV_IterTag::n_skip, SSERV_IterTag::name, NCBI_CONNECT_SRAND_ADDEND, NCBI_CXX_TOOLKIT, NCBI_DISP_VERSION, SDISPD_Data::net_info, SSERV_IterTag::op, s_Close(), s_Reset(), s_Resolve(), SSERV_IterTag::time, and SSERV_IterTag::types.
Referenced by x_Open().
|
static |