A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/ncbi__conn__test_8cpp_source.html below:

NCBI C++ ToolKit: src/connect/ncbi_conn_test.cpp Source File

44 #define HELP_EMAIL (m_Email.empty() \ 45  ? string("NCBI Help Desk <info@ncbi.nlm.nih.gov>"

) \

48 #define NCBI_WWW DEF_CONN_HOST 49 #define NCBI_WWW_BEMD "www.be-md.ncbi.nlm.nih.gov" 50 #define NCBI_FWD_BEMD "130.14.29.112" 65  "NCBI Firewall Daemon: Invalid ticket. Connection closed."

;

86

: m_Output(

output

), m_Width(width),

131  if

((status = (this->*check[s])(reason)) !=

eIO_Success

) {

135

}

while

(

EStage

(s++) < stage);

151  string result

(

"Make sure the specified timeout value of "

);

153  result

+=

"s is adequate for your network throughput\n"

;

164

+ (!

type

.empty() && !

text

.empty() ?

"; "

:

""

) +

178

status = r_status > w_status ? r_status : w_status;

215  void

*

data

,

int

server_error)

226  void

*

data

,

int

server_error)

231

auxdata->

m_Failed

= server_error != 301 && server_error != 302;

237  void

*

data

,

int

server_error)

243

*((

int

*) auxdata->

m_Data

) =

285  static const struct

{

295  "www.google.com"

, 0 },

307  eIO_Unknown

,

"Unable to build connection parameters"

);

313

net_info->timeout = timeout;

314

net_info->max_try = 0;

319  unsigned int

nanosec;

321

::sprintf(net_info->path,

"/NcbiTest%08lX%08lX"

,

322

(

unsigned long

) sec, (

unsigned long

) nanosec);

325

vector< AutoPtr<CConn_HttpStream> > http;

326  for

(

n

= 0;

n

<

sizeof

(kTests) /

sizeof

(kTests[0]); ++

n

) {

327  char

user_header[80];

328

net_info->scheme = kTests[

n

].scheme;

329  const char

* host = kTests[

n

].host;

330  const char

* vhost = kTests[

n

].vhost;

332  _ASSERT

(::strlen(host) <

sizeof

(net_info->host) - 1);

333

::strcpy(net_info->host, host);

336  _ASSERT

(::strlen(vhost) + 6 <

sizeof

(user_header) - 1);

337

::sprintf(user_header,

"Host: %s"

, vhost);

339

*user_header =

'\0'

;

344

http.back()->SetCanceledCallback(

m_Canceled

);

366  if

(status < readst && (*h)->GetStatusCode() != 404)

390  "Checking whether NCBI is known to DNS"

);

396  "Checking for a proxy..."

);

398  if

(!net_info || !net_info->http_proxy_host[0]) {

399  result

=

"No proxy detected in configuration"

;

403  "Resolving \""

+

string

(net_info->http_proxy_host) +

'"'

);

405  result

=

"Unable to resolve proxy host \"" 406

+

string

(net_info->http_proxy_host) +

'"'

;

429  "Checking whether NCBI is HTTP(S) accessible"

);

434  eIO_Unknown

,

"Unable to build connection parameters"

);

439  if

(net_info->http_proxy_host[0] && net_info->http_proxy_port)

466

temp +=

"Your HTTP connection appears to work but it does not seem" 467  " to be able to upgrade to secure HTTP (HTTPS), most likely" 468  " because of an incompatibility of the encryption algorithms"

;

470

temp +=

" or a malfunctioning HTTP proxy server in the way\n"

;

475  bool

port = net_info->port != 0;

478

temp +=

"Please make sure that "

;

482

temp += net_info->host;

483

temp += port ?

"\""

:

"\" and "

;

492

temp +=

n

> 1 ?

" are"

:

" is"

;

493

temp +=

" redefined correctly\n"

;

498

temp +=

"Please make sure that the HTTP proxy server \'"

;

499

temp += net_info->http_proxy_host;

502

temp +=

"' specified with "

;

503  if

(net_info->http_proxy_mask) {

504

temp +=

"the environment variable"

;

508

temp +=

" 'http_proxy'"

;

512

temp +=

" 'https_proxy'"

;

516

temp +=

" is correct"

;

517  if

(!net_info->http_proxy_mask && net_info->http_proxy_skip

518

&& (getenv(

"http_proxy"

) || getenv(

"https_proxy"

))) {

519

temp +=

": the proxy location was loaded this way because " 521  " is set, and that prevents reading 'http_proxy' and/or" 522  " 'https_proxy' from the environment"

;

527

temp +=

"; also note that (in addition to 'http_proxy') a" 528  " setting of 'https_proxy' is usually required to properly" 529  " forward secure HTTP (HTTPS) traffic"

;

531  if

(net_info->http_proxy_mask) {

532

temp +=

"\nAlternatively, you can configure your HTTP proxy" 534  " (both must be set) and by disabling loading it from the" 535  " environment by setting " 540  if

(net_info->http_proxy_host[0] || net_info->http_proxy_port) {

541

temp +=

"Note that your HTTP proxy seems to have been" 542  " specified only partially, and thus cannot be used: the "

;

543  if

(net_info->http_proxy_port) {

544

temp +=

"host part is missing (for port :" 547

temp +=

"port part is missing (for host \'" 548

+

string

(net_info->http_proxy_host) +

'\''

;

551

}

else if

(net_info->http_proxy_skip

552

&& (getenv(

"http_proxy"

) || getenv(

"https_proxy"

))) {

553

temp +=

"Even though you seem to have 'http_proxy' and/or" 554  " 'https_proxy' defined in your environment, " 556  " is also set and, thus, prevents reading them"

;

559

temp +=

"If your network access requires the use of an HTTP" 560  " proxy server, please contact your network administrator," 563  " (both must be set) in your configuration accordingly"

;

567

temp +=

"; and if your proxy server requires authorization, please" 568  " check that appropriate [" 572  if

(*net_info->user || *net_info->pass) {

573

temp +=

"Make sure there are no stray values for [" 575  "} in your configuration -- basic NCBI services neither" 576  " require nor use them\n"

;

579

temp +=

"Your application may also need to have the Secure Socket" 580  " Layer (SSL) support turned on\n"

;

595  "Checking whether NCBI dispatcher is okay"

);

607

http.read(

buf

,

sizeof

(

buf

));

622

temp =

"Make sure there are no stray values for [" 628

temp +=

"Service response was not recognized; please contact " 634

temp +=

"Check with your network administrator that your network" 635  " neither filters out nor blocks non-standard HTTP headers\n"

;

638

temp +=

"NCBI network dispatcher must be accessed via HTTPS\n"

;

651  static const char

kBounceTest[] =

"NcbiBounceTest"

;

654  "Checking whether NCBI services operational"

);

659

net_info->lb_disable = 1

;

668  bool

responded = temp.size() > 0 ?

true

:

false

;

698

temp =

str

?

"Substituted service"

:

"Service"

;

699

temp +=

" cannot be located"

;

702

temp = responded ?

"Unrecognized"

:

"No"

;

703

temp +=

" response from "

;

704

temp +=

str

?

"substituted service"

:

"service"

;

708

temp +=

"; please remove ["

;

713

temp +=

"\" from your configuration\n"

;

715

temp +=

"; please contact "

+

HELP_EMAIL

+

'\n'

;

720

temp +=

"Network dispatcher is not enabled as a service" 721  " locator; please review your configuration to purge any" 724  if

(!mapper.empty() && mapper != (x_mapper ? x_mapper :

""

)){

725

temp +=

"It appears that \""

+ mapper +

"\" is currently" 726  " set as your default service locator\n"

;

747  static const char

kFWDUrl[] =

"/IEB/ToolBox/NETWORK/fwd_check.cgi"

;

751

fwdurl,

sizeof

(fwdurl), kFWDUrl)) {

761  bool

responded =

false

;

762  while

(fwdcgi.getline(line,

sizeof

(line))) {

797  m_Fwd

.push_back(cp);

802  return ConnStatus

(!responded || (fwdcgi.fail() && !fwdcgi.eof()), &fwdcgi);

810  const char

* user_header;

813  if

(net_info->firewall) {

814

user_header =

"NCBI-RELAY: FALSE"

;

817

user_header =

"NCBI-RELAY: TRUE"

;

818  if

(net_info->stateless)

823  string

temp(

m_Firewall

?

"FIREWALL"

:

"RELAY (legacy)"

);

824

temp +=

" connection mode has been detected for stateful services\n"

;

826

temp +=

"This mode requires your firewall to be configured in such a" 827  " way that it allows outbound connections to the port range [" 830  "] (inclusive) at the fixed NCBI address " NCBI_FWD_BEMD ".\n" 831  "To set that up correctly, please have your network administrator" 832  " read the following (if they have not already done so):" 835

temp +=

"This is an obsolescent mode that requires keeping a wide port" 836  " range [4444..4544] (inclusive) open to allow through connections" 837  " to the entire NCBI site (130.14.xxx.xxx) -- this" 838  " mode was designed for unrestricted networks when firewall port" 839  " blocking had not been an issue\n"

;

841  char

fwbset[256] = {

'\0'

};

844  switch

(net_info->firewall) {

846

temp +=

"Also, there usually exist a few additional ports such as " 849  ", which can be used if connections to the ports in the range" 850  " shown above, have failed\n"

;

853

temp +=

"Furthermore, your configuration explicitly forbids to use" 854  " any fallback firewall ports that may exist to improve" 855  " reliability of the connectivity with NCBI\n"

;

858

temp +=

"Normally, there are a few additional backup connection" 861  " can be used as a failover should connections to the above" 862  " port range be unsuccessful. However, your configuration" 863  " explicitly requests that only"

;

865  if

(*fwbset &&

strcmp

(fwbset,

"0"

) != 0) {

866

temp +=

" the following fallback port(s) may be used for" 872

temp +=

" those fallback firewall ports (if any active) are to" 873  " be used for connections."

;

875

temp +=

" This also implies that no conventional ports from the" 876  " default range need to be configured, and none are going to" 880

temp +=

"Internal program error, please report!\n"

;

885

temp +=

"This mode may not be reliable if your site has a restraining" 886  " firewall imposing a fine-grained control over which hosts and" 887  " ports the outbound connections are allowed to use\n"

;

890

temp +=

"Connections to the aforementioned ports will be made via an" 892

temp += net_info->http_proxy_host;

896  if

(net_info->http_proxy_leak) {

897

temp +=

". If that is unsuccessful, a link bypassing the proxy" 898  " will then be attempted\n"

;

906  "Obtaining current NCBI "

+

907  string

(

m_Firewall

?

"firewall settings"

:

"service entries"

));

942

temp += up == 1 ?

" port"

:

" ports"

;

950

temp =

"No connection ports were found"

;

952

temp +=

": it is quite possible that none of the fallback" 953  " ports supported by NCBI match the restrictive set ["

;

955

temp +=

"] imposed by your configuration. Please make sure " 957  " compatible value(s)"

;

964

temp +=

"You may want to contact "

+

HELP_EMAIL

;

972  "Verifying configuration for consistency"

);

975  bool

firewall =

true

;

982

+

" is not operational, "

;

987

temp +=

"trying to use fallback port(s) only"

;

988

temp.insert(0,

"OK\n"

);

997

temp =

"Fallback port(s) found in non-firewall mode, please" 1001

temp =

"Firewall "

;

1002

temp += firewall ?

"wrongly"

:

"not"

;

1003

temp +=

" acknowledged, please contact "

+

HELP_EMAIL

;

1018  static const STimeout

kZeroTmo = { 0, 0 };

1022  string

temp(

"Checking individual connection points..\n"

);

1025

temp +=

"NOTE that even though that not the entire port range may" 1026  " currently be utilized and checked, in order for NCBI" 1027  " services to work correctly and seamlessly, your network must" 1028  " support all ports in the range as documented above\n"

;

1032

?

"Fallback"

:

"Also, adaptive"

,

1033

temp +=

" firewall mode allows that some (but not all) fallback" 1034  " firewall ports may fail to operate. Only those ports found" 1035  " in working order will be used to access NCBI services\n"

;

1037

net_info->path[0] =

'\0'

;

1051  for

(

n

= 0; net_info &&

n

<

sizeof

(fwd) /

sizeof

(fwd[0]); ++

n

) {

1056  typedef

pair<AutoPtr<CConn_IOStream>,

CFWConnPoint

*> CFWCheck;

1057

vector<CFWCheck> fwck;

1070

net_info->port = cp->port;

1086

fwck.push_back(make_pair(fw, &*cp));

1090  unsigned int

valid = 0;

1114  char

line[

sizeof

(

kFWSign

) + 2

];

1115  if

(!fw->getline(line,

sizeof

(line)))

1128

vector<CSocketAPI::SPoll>

poll

;

1129  ITERATE

(vector<CFWCheck>, ck, fwck) {

1140  ITERATE

(vector<CFWCheck>, ck, fwck)

1162  switch

(cp->status) {

1176 #ifdef NCBI_COMPILER_WORKSHOP 1178

distance(fwd[

n

]->begin(), cp, k);

1180

k = distance(fwd[

n

]->begin(), cp);

1182  if

(!fwck[k].

first

)

1200  m_CheckPoint

=

"Internal program error, please report!"

;

1214

temp +=

"Your HTTP proxy '"

;

1215

temp += net_info->http_proxy_host;

1218

temp +=

"' may not allow connections relayed to "

;

1219

temp +=

n

?

"fallback"

:

"non-conventional"

;

1220

temp +=

" ports; please get in touch with your network" 1226

temp +=

"\nYou can also try setting " 1228  "=1 in your configuration to allow a proxy bypass" 1229  " retry logic for non-HTTP traffic\n"

;

1231

temp +=

"The network port required for this connection to" 1232  " succeed may be blocked/diverted at your firewall;"

;

1234

temp +=

" please contact your network administrator"

;

1236

temp +=

" and have them read the following: " 1244  " more narrow port range"

;

1252

temp +=

"Not all NCBI stateful services require to work" 1253  " over dedicated (persistent) connections; some can" 1254  " still work (at the cost of degraded performance)" 1255  " over a stateless carrier such as HTTP; try setting" 1257  " in your configuration\n"

;

1260

temp =

"Now checking fallback port(s)..."

;

1280

temp =

m_Firewall

?

"Firewall port"

:

"Service entry"

;

1281

temp +=

" check FAILED"

;

1284

temp =

"Firewall port check PASSED"

;

1286

temp +=

" only with fallback port(s)"

;

1290  char

fwbset[256] = {

'\0'

};

1292  EFWMode

(net_info->firewall));

1293  if

(*fwbset &&

strcmp

(fwbset,

"0"

) != 0) {

1300

temp +=

"\nYou may want to read this link for more information: " 1305

?

"firewall port(s)" 1306

:

"service entry point(s)"

) +

" checked OK"

;

1317 static inline unsigned int ud

(time_t one, time_t two)

1319  return

(

unsigned int

)(one > two ? one - two : two - one);

1323 static inline size_t rnd

(

size_t

minimal,

size_t

maximal)

1325  return

minimal <= maximal ? minimal + rand() % (maximal - minimal + 1) : 0;

1332  "Checking reachability of a stateful service"

);

1339  char

send[(1 << 10) + (8 + 1)];

1340  char

recv[

sizeof

(send)];

1341

sprintf(send,

"%08X"

, (

unsigned int

)

seed

);

1342  size_t size

=

rnd

(2, (

sizeof

(send) - (8 + 1)) >> 3);

1345  for

(

i

= 1;

i

<

size

; ++

i

)

1346

sprintf(send + (

i

<< 3),

"%08X"

, (

unsigned int

) rand());

1347

memset(&send[

size

<<= 3], 0, 8);

1348

send[

size

+= 8] =

'\0'

;

1355  bool

iofail = !echo.write(send,

size

) || !echo.flush()

1358  if

(

n

< (streamsize)

size

) {

1359  if

(!echo.read(recv +

n

, (streamsize)

size

-

n

))

1364  if

(

n

== (streamsize)

size

) {

1365  for

(

i

= 8;

i

<

size

; ++

i

) {

1366  if

(send[

i

] != recv[

i

])

1370

time_t now = (time_t) NStr::StringToNumeric<unsigned int>

1389

temp =

n

?

"Unrecognized"

:

"No"

;

1390

temp +=

" response received from substituted service;" 1391  " please remove ["

;

1396

temp +=

"\" from your configuration\n"

;

1405

temp =

n

?

"Unrecognized"

:

"No"

;

1406

temp +=

" response received from service. "

;

1410  if

(

m_Stateless

|| (net_info && net_info->stateless)) {

1411

temp +=

"STATELESS mode forced by your configuration may be" 1412  " preventing this stateful service from operating" 1413  " properly; try to remove ["

;

1421

}

else if

(!

str

) {

1426

temp +=

"The service is currently unavailable;" 1427  " you may want to contact "

+

HELP_EMAIL

+

'\n'

;

1428

}

else if

(

m_Fwd

.empty() && net_info

1430

temp +=

"The most likely reason for the failure is that" 1431  " your firewall is still blocking ports as reported" 1434

temp +=

"Please contact "

+

HELP_EMAIL

+

'\n'

;

1437

}

else if

(!

str

) {

1439

temp +=

"NCBI Firewall"

;

1440  if

(!net_info->firewall)

1441

temp +=

" (Connection Relay)"

;

1442

temp +=

" Daemon reports negotitation error"

;

1443  if

(net_info &&

m_HttpProxy

&& !net_info->http_proxy_leak

1445

temp +=

", which usually means that an intermediate HTTP" 1447

temp += net_info->http_proxy_host;

1450

temp +=

"' may be buggy."

;

1453

temp +=

" Please contact your network administrator\n"

;

1455

temp +=

n

?

"Unrecognized"

:

"No"

;

1456

temp +=

" response from service;" 1471  const string

& title)

1489  if

(!

stmt

.empty()) {

1494  str

->append(1,

'.'

);

1498  ITERATE

(list<string>, line, par) {

1527  if

(reason.empty()) {

1533  if

(!

stmt

.empty())

1542  if

(!

stmt

.empty())

1550  str

->append(1,

'.'

);

1556

pfx1.assign(

buf

, ::sprintf(

buf

,

"%2d. "

, ++

n

));

1562  ITERATE

(list<string>, line, par) {

1585  static const STimeout

kFast = { 2, 0 };

1591  if

(http.getline(line,

sizeof

(line))

1592

&& ::sscanf(line,

"HTTP/%*d.%*d %d "

, &

code

) >= 1

This stream exchanges data with an HTTP server located at the URL: http[s]://host[:port]/path[?...

Base class, inherited from "std::iostream", does both input and output, using the specified CONNECTOR...

This stream exchanges data with a named service, in a constraint that the service is implemented as o...

This stream exchanges data in a TCP channel, using the SOCK socket API.

CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...

Interface for testing cancellation request in a long lasting operation.

static CS_CONNECTION * conn

static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)

static SQLCHAR output[256]

static const char * str(char *buf, int n)

#define poll(fds, nfds, timeout)

static const STimeout kTimeout

void reset(element_type *p=0, EOwnership ownership=eTakeOwnership)

Reset will delete the old pointer (if owned), set content to the new value, and assume the ownership ...

#define ITERATE(Type, Var, Cont)

ITERATE macro to sequence through container elements.

#define ERASE_ITERATE(Type, Var, Cont)

Non-constant version with ability to erase current element, if container permits.

element_type * get(void) const

Get pointer.

#define VECTOR_ERASE(Var, Cont)

Use this macro inside body of ERASE_ITERATE cycle to erase from vector-like container.

#define NON_CONST_ITERATE(Type, Var, Cont)

Non constant version of ITERATE macro.

EIO_Status SetCanceledCallback(const ICanceled *canceled)

Cancellation support.

EIO_Status SetTimeout(EIO_Event direction, const STimeout *timeout) const

Set connection timeout for "direction".

string GetType(void) const

EIO_Status Status(EIO_Event direction=eIO_Close) const

string GetDescription(void) const

CSocket & GetSocket(void)

Get CSocket, if available (else empty).

EIO_Status CONN_Read(CONN conn, void *buf, size_t size, size_t *n_read, EIO_ReadMethod how)

EIO_Status CONN_SetTimeout(CONN conn, EIO_Event event, const STimeout *timeout)

Specify timeout for the connection I/O, including "Connect" (aka "Open") and "Close".

EIO_Status CONN_Wait(CONN conn, EIO_Event event, const STimeout *timeout)

Block on the connection until it becomes available for either reading or writing (depending on "event...

EHTTP_HeaderParse

The extended version HTTP_CreateConnectorEx() is able to track the HTTP response chain and also chang...

const STimeout g_NcbiDefConnTimeout

DEF_CONN_TIMEOUT as STimeout.

@ fHTTP_AdjustOnRedirect

Call adjust routine for redirects, too.

@ fHTTP_NoAutoRetry

No auto-retries allowed.

@ fHTTP_KeepHeader

Keep HTTP header (see limitations)

@ eHTTP_HeaderSuccess

Parse succeeded, retain server status.

@ eHTTP_HeaderContinue

Parse succeeded, continue with body.

#define THROWS_NONE

Do not use 'throw' dynamic exception specification for C++11 compilers.

bool NotNull(void) const THROWS_NONE

Check if pointer is not null – same effect as NotEmpty().

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

#define NCBI_AS_STRING(value)

Convert some value to string even if this value is macro itself.

SSERV_InfoCPtr SERV_GetNextInfo(SERV_ITER iter)

Same as "SERV_GetNextInfoEx(., 0)" – i.e.

void SERV_Close(SERV_ITER iter)

Deallocate the iterator.

SERV_ITER SERV_OpenSimple(const char *service)

Allocate an iterator and consult either local databases (if any present), or network database,...

@ fSERV_Stateless

Stateless servers only.

static CNCBI_IPAddr gethostbyname(const string &host, ESwitch log=eOff)

Return 0 or empty address on error.

static EIO_Status Poll(vector< SPoll > &polls, const STimeout *timeout, size_t *n_ready=0)

Poll a vector of CPollable objects for I/O readiness.

static size_t StringToHostPort(const string &str, unsigned int *host, unsigned short *port)

Return number of characters parsed (0 if cannot detect "host:port"), and string::npos on error ("host...

static string HostPortToString(const CNCBI_IPAddr &addr, unsigned short port)

See SOCK_HostPortToString[6], return empty when failed.

static string ntoa(const CNCBI_IPAddr &addr)

BSD-like API.

virtual bool IsCanceled(void) const =0

IO_PREFIX::ostream CNcbiOstream

Portable alias for ostream.

static streamsize Readsome(CNcbiIstream &is, CT_CHAR_TYPE *buf, streamsize buf_size)

NCBI_NS_STD::string::size_type SIZE_TYPE

static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)

Case-insensitive compare of a substring with another string.

static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)

Split a string using specified delimiters.

static SIZE_TYPE FindNoCase(const CTempString str, const CTempString pattern, SIZE_TYPE start, SIZE_TYPE end, EOccurrence which=eFirst)

Find the pattern in the specified range of a string using a case insensitive search.

static bool EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)

Check if a string ends with a specified suffix value.

static int strncasecmp(const char *s1, const char *s2, size_t n)

Case-insensitive comparison of two zero-terminated strings, narrowed to the specified number of chara...

static void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)

Truncate whitespace in a string (in-place)

static int Compare(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)

Compare of a substring with another string.

static string UIntToString(unsigned int value, TNumToStringFlags flags=0, int base=10)

Convert UInt to string.

static bool SplitInTwo(const CTempString str, const CTempString delim, string &str1, string &str2, TSplitFlags flags=0)

Split a string into two pieces using the specified delimiters.

static list< string > & Justify(const CTempString str, SIZE_TYPE width, list< string > &par, const CTempString *pfx=0, const CTempString *pfx1=0)

Justify the specified string into a series of lines of the same width.

static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)

Convert numeric value to string.

static string & ToUpper(string &str)

Convert string to upper case – string& version.

static string UInt8ToString(Uint8 value, TNumToStringFlags flags=0, int base=10)

Convert UInt8 to string.

@ fConvErr_NoThrow

Do not throw an exception on error.

@ fSplit_MergeDelimiters

Merge adjacent delimiters.

bool IsExpired(void) const

Check if the deadline is expired.

time_t GetTimeT(void) const

Get time in time_t format.

CTime & SetTimeT(const time_t t)

Set time using time_t time value.

const long kMicroSecondsPerSecond

Number of microseconds in one second.

const long kNanoSecondsPerSecond

Number of nanoseconds in one second.

void GetExpirationTime(time_t *sec, unsigned int *nanosec) const

Get the number of seconds and nanoseconds (since 1/1/1970).

@ eCurrent

Use current time. See also CCurrentTime.

int ConnNetInfo_SetupStandardArgs(SConnNetInfo *net_info, const char *service)

int ConnNetInfo_OverrideUserHeader(SConnNetInfo *net_info, const char *header)

int ConnNetInfo_SetArgs(SConnNetInfo *net_info, const char *args)

#define REG_CONN_STATELESS

unsigned int usec

microseconds (modulo 1,000,000)

#define REG_CONN_FIREWALL

#define REG_CONN_HTTP_PROXY_LEAK

const char * IO_StatusStr(EIO_Status status)

Get the text form of an enum status value.

int ConnNetInfo_SetUserHeader(SConnNetInfo *net_info, const char *header)

#define DEF_CONN_REG_SECTION

#define REG_CONN_DISPD_DISABLE

#define REG_CONN_HTTP_PROXY_SKIP

#define REG_CONN_SERVICE_NAME

EBDebugPrintout debug_printout

void ConnNetInfo_Destroy(SConnNetInfo *net_info)

@ eIO_Timeout

timeout expired before any I/O succeeded

@ eIO_Interrupt

signal arrival prevented any I/O to succeed

@ eIO_NotSupported

operation is not supported or is not available

@ eIO_Success

everything is fine, no error occurred

@ eIO_Unknown

unknown I/O error (likely fatal but can retry)

@ eIO_InvalidArg

bad argument / parameter value(s) supplied

@ fProxy_Http

$http_proxy used

@ fProxy_Https

$https_proxy used

@ eFWMode_Firewall

Regular firewall ports only, no fallback.

@ eFWMode_Adaptive

Regular firewall ports first, then fallback.

@ eFWMode_Fallback

Fallback ports only (w/o trying any regular)

@ eIO_ReadPlain

read readily available data only, wait if none

@ eIO_Open

also serves as no-event indicator in SOCK_Poll

@ eIO_Close

also serves as an error indicator in SOCK_Poll

const STimeout * m_Timeout

As supplied in constructor.

virtual EIO_Status GetFWConnections(string *reason)

virtual EIO_Status StatefulOkay(string *reason)

EStage

Note that each stage has a previous one as a prerequisite, with the only exception for the stateful s...

virtual EIO_Status Execute(EStage &stage, string *reason=0)

Execute the test suite from the very first (eHttp) up to and including the requested "stage".

virtual void PostCheck(EStage stage, unsigned int step, EIO_Status status, const string &reason)

PostCheck gets called upon successful ("status" contains eIO_Success) or unsuccessful (otherwise) com...

virtual void PreCheck(EStage stage, unsigned int step, const string &title)

User-defined rendering callbacks: PreCheck() and PostCheck().

bool m_HttpProxy

Certain properties of communication as determined by configuration.

virtual EIO_Status HttpOkay(string *reason)

virtual EIO_Status CheckFWConnections(string *reason)

CConnTest(const STimeout *timeout=kDefaultTimeout, CNcbiOstream *output=0, SIZE_TYPE width=72)

Create test suite.

bool m_End

Check step start (false) / stop (true) indicator.

virtual EIO_Status ExtraCheckOnFailure(void)

Last resort check.

EIO_Status x_CheckTrap(string *reason)

Pretect from runaway stage argument.

vector< CFWConnPoint > m_FwdFB

Fallback connection points.

virtual EIO_Status ConnStatus(bool failure, CConn_IOStream *io)

Helper function that assures to return eIO_Success if the predicate "failure" is false; and other cod...

virtual EIO_Status ServiceOkay(string *reason)

vector< CFWConnPoint > m_Fwd

Firewall daemon configuration as obtained from NCBI.

const string & GetCheckPoint(void) const

Extended info of the last step IO.

EDebugPrintout m_DebugPrintout

CConstIRef< ICanceled > m_Canceled

Cancellation support.

virtual EIO_Status DnsOkay(string *reason)

User-redefinable checks for each stage.

EIO_Status x_GetFirewallConfiguration(const SConnNetInfo *net_info, bool fwbports)

Obtain and populate FWD connection points from NCBI.

virtual EIO_Status DispatcherOkay(string *reason)

EIO_Status status

Check result.

void SetTimeout(const STimeout *timeout=kDefaultTimeout)

string x_TimeoutMsg(void)

Return verbal timeout suggestion.

static bool IsNcbiInhouseClient(void) THROWS_NONE

Return TRUE if the client is inside NCBI, FALSE otherwise.

@ eStatelessService

Check whether simplest NCBI service works.

@ eFirewallConnPoints

Obtain all FW ports for stateful services.

@ eHttp

Check whether HTTP works.

@ eStatefulService

Check whether NCBI stateful service works.

@ eDispatcher

Check whether NCBI dispatcher works.

@ eFirewallConnections

Check all FW ports, falling back if needed.

@ eNone

Zero placeholder.

if(yy_accept[yy_current_state])

static void text(MDB_val *v)

constexpr bool empty(list< Ts... >) noexcept

const struct ncbi::grid::netcache::search::fields::SIZE size

int strcmp(const char *str1, const char *str2)

#define CONN_FWD_PORT_MAX

#define CONN_FWD_PORT_MIN

static const char kTestService[]

static bool operator>(const STimeout *t1, const STimeout &t2)

static bool x_IsFatalError(int error)

static const char kCanceled[]

static const char kEchoService[]

static EHTTP_HeaderParse s_SvcHeader(const char *header, void *data, int server_error)

static size_t rnd(size_t minimal, size_t maximal)

static unsigned int ud(time_t one, time_t two)

static const SIZE_TYPE kParIndent

static int s_Adjust(SConnNetInfo *, void *data, unsigned int count)

static bool x_Large(const STimeout *t)

static SConnNetInfo * ConnNetInfo_Create(const char *svc_name, EDebugPrintout dbg_printout)

static EHTTP_HeaderParse s_GoodHeader(const char *, void *data, int server_error)

static const char kBounceService[]

static void s_Cleanup(void *data)

static const char kFWSign[]

static EHTTP_HeaderParse s_AnyHeader(const char *, void *data, int server_error)

const char * ConnNetInfo_GetValueInternal(const char *service, const char *param, char *value, size_t value_size, const char *def_value)

void SERV_PrintFirewallPorts(char *buf, size_t bufsize, EFWMode mode)

void SERV_InitFirewallPorts(void)

int SERV_IsFirewallPort(unsigned short port)

int SERV_AddFirewallPort(unsigned short port)

char * SERV_ServiceName(const char *service)

const char * SERV_MapperName(SERV_ITER iter)

Useful/utility classes and methods.

static SLJIT_INLINE sljit_ins st(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)

Auxiliary class to hold FWDaemon CP(connection point) information and its current status.

The polling structure m_Event can be either of eIO_Open, eIO_Read, eIO_Write, eIO_ReadWrite.

static void Delete(SConnNetInfo *net_info)

Functor template for deleting object.

const ICanceled * m_Canceled

SAuxData(const ICanceled *canceled, void *data)


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