"LBNULL_DOMAIN"
56 #define REG_CONN_LBNULL_DEBUG DEF_CONN_REG_SECTION "_""LBNULL_DEBUG"
60 #define REG_CONN_LBNULL_VHOST "LBNULL_VHOST" 62 #define REG_CONN_LBNULL_PORT "LBNULL_PORT" 66 #define REG_CONN_LBNULL_PATH DEF_CONN_REG_SECTION "_""LBNULL_PATH"
112ipv4 = (
unsigned int)(-1);
120 size_tportlen =
data->vhost ? sprintf(
port,
":%hu",
data->port) : 0;
123 data->vhost ?
len+ portlen + 1 : 0);
139memcpy(x_port,
port, portlen);
144 info->vhost = (
unsignedchar)
len;
160(
"[%s] LBNULL cannot create server info", iter->
name));
165memcpy(&
info->addr, &ipv6,
sizeof(
info->addr));
170(
"[%s] %s", iter->
name, infostr ? infostr :
"<NULL>"));
177(
"[%s] LBNULL cannot store server info", iter->
name));
181 return data->info ? 1
: 0
;
193 if(!
data->info && !
data->reset) {
194 CORE_TRACEF((
"Leave LBNULL::s_GetNextInfo(\"%s\"): EOF", iter->
name));
201(
"[%s] Unable to resolve", iter->
name));
211 CORE_TRACEF((
"Leave LBNULL::s_GetNextInfo(\"%s\"): \"%s\" %p",
222 data->info ? 1 : 0));
245 #define isdash(s) ((s) == '-' || (s) == '_') 249 intdot = *domain ==
'.'? 1
: 0
;
250 const char* ptr = dot ? ++domain : domain;
256 for( ; *ptr; ++ptr) {
258 if(dot || (alpha &&
isdash(ptr[-1])))
263 if((dot || ptr == domain) &&
isdash(*ptr))
266 if(
isdigit((
unsigned char)(*ptr)))
273 len= (size_t)(ptr - domain);
275 if(domain[
len- 1] ==
'.')
280 assert(!ptr || ptr > domain);
281 if(ptr == domain +
len)
283}
else if(
isdash(ptr[-1]))
298 const char*
path= 0;
326(
"[%s] Argument affinity lookup not supported by LBNULL:" 327 " %s%s%s%s%s", iter->
name, iter->
arg, &
"="[!iter->
val],
328&
"\""[!iter->
val], iter->
val? iter->
val:
"",
329&
"\""[!iter->
val]));
332 CORE_TRACEF((
"[%s] LBNULL using server type \"%s\"",
336 buf,
sizeof(
buf), 0)) {
338(
"[%s] Cannot obtain port number from registry for LBNULL",
347 port= strtoul(
buf, &end, 0);
348 if(errno || *end ||
port> 0xFFFF)
353(
"[%s] Bad default port number \"%s\" for LBNULL",
364 buf,
sizeof(
buf),
"/")) {
366(
"[%s] Cannot obtain URL path from registry for LBNULL",
372(
"[%s] Cannot store path \"%s\" for LBNULL",
382(
"[%s] Service name too long for LBNULL",
392(
"[%s] Cannot obtain domain name from registry for LBNULL",
400(
"[%s] Bad domain name \"%s\" for LBNULL",
401iter->
name, domain));
404 size_tdomlen = strlen(domain);
405 assert(domlen > 1 || *domain !=
'.');
406 if(domain[domlen - 1] ==
'.')
408 if(domain[ 0] !=
'.') {
412 memmove(domain - 1, domain, domlen);
417(
"[%s] Domain name \"%.*s\" too long for LBNULL",
428(
"[%s] LBNULL failed to allocate for SLBNULL_Data",
437 buf,
sizeof(
buf), 0));
440 buf,
sizeof(
buf), 0));
442 data->port = (
unsignedshort)
port;
449(
"SERV_LBNULL_Open(\"%s\"): Service not found",
std::ofstream out("events_result.xml")
main entry point for tests
static const struct type types[]
SSERV_Info * SERV_CreateStandaloneInfo(unsigned int host, unsigned short port)
SSERV_Info * SERV_CreateDnsInfo(unsigned int host)
size_t SERV_SizeOfInfo(const SSERV_Info *info)
const char * SERV_TypeStr(ESERV_Type type)
char * SERV_WriteInfo(const SSERV_Info *info)
unsigned short TSERV_TypeOnly
Server type only, w/o specials.
@ fSERV_Stateless
Stateless servers only.
TNCBI_IPv6Addr * SOCK_gethostbynameEx6(TNCBI_IPv6Addr *addr, const char *hostname, ESwitch log)
Find and return an Internet address of a named host.
int ConnNetInfo_Boolean(const char *str)
unsigned int
A callback function used to compare two keys in a database.
if(yy_accept[yy_current_state])
#define LBSM_DEFAULT_RATE
#define LBSM_DEFAULT_TIME
const char * ConnNetInfo_GetValueService(const char *service, const char *param, char *value, size_t value_size, const char *def_value)
const char * ConnNetInfo_GetValueInternal(const char *service, const char *param, char *value, size_t value_size, const char *def_value)
int NcbiIsEmptyIPv6(const TNCBI_IPv6Addr *addr)
Return non-zero if the address is empty (either as NULL or IPv6 or IPv4); return zero otherwise.
unsigned int NcbiIPv6ToIPv4(const TNCBI_IPv6Addr *addr, size_t pfxlen)
Extract and return a network byte order IPv4 embedded address from an IPv6 address,...
const char * NcbiStringToIPv4(unsigned int *addr, const char *str, size_t len)
Convert into a network byte order IPv4 address, the first "len" (or "strlen(str)" if "len" is 0) byte...
#define REG_CONN_LBNULL_PORT
static void s_Close(SERV_ITER)
static void s_Reset(SERV_ITER)
#define REG_CONN_LBNULL_DOMAIN
#define REG_CONN_LBNULL_DEBUG
static const SSERV_VTable kLbnullOp
static int s_Resolve(SERV_ITER iter)
const SSERV_VTable * SERV_LBNULL_Open(SERV_ITER iter, SSERV_Info **info)
#define REG_CONN_LBNULL_PATH
static SSERV_Info * s_GetNextInfo(SERV_ITER, HOST_INFO *)
static int x_CheckDomain(const char *domain)
#define REG_CONN_LBNULL_VHOST
#define CORE_LOGF_X(subcode, level, fmt_args)
#define CORE_LOGF_ERRNO_X(subcode, level, error, fmt_args)
#define CORE_TRACEF(fmt_args)
#define CORE_LOGF(level, fmt_args)
SSERV_Info * SERV_CopyInfoEx(const SSERV_Info *orig, const char *name)
SSERV_Info * SERV_CreateHttpInfoEx(ESERV_Type type, unsigned int host, unsigned short port, const char *path, const char *args, size_t add)
const char * SERV_NameOfInfo(const SSERV_Info *info)
ESERV_Type SERV_GetImplicitServerTypeInternalEx(const char *service, ESERV_Type default_type)
voidp calloc(uInt items, uInt size)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4