timeout, buf_size, flgs,
79timeout, buf_size, flgs,
93 #define GET_CONN(sb) ((sb) ? (sb)->GetCONN() : 0) 216memset(&cb, 0,
sizeof(cb));
258 unsigned shortmax_try,
265timeout, buf_size,
flags)
273 unsigned shortaport,
274 unsigned shortmax_try,
279 size_t len= ahost.size();
280 stringx_host, xx_port;
285 if((port = aport) != 0 &&
len) {
289|| x_host.empty() || xx_port.empty()
290|| !
isdigit((
unsigned char) xx_port[0]) || xx_port[0] ==
'0' 293|| (x_port ^ (x_port & 0xFFFF))) {
295 "CConn_SocketStream::CConn_SocketStream(\"" 297 " Invalid/insufficient destination address");
313 unsigned shortmax_try,
319timeout, buf_size,
flags)
333timeout, buf_size,
flags)
344 "CConn_SocketStream::CConn_SocketStream(): " 345 " Socket may not be empty");
349 "CConn_SocketStream::CConn_SocketStream(): " 350 " Socket must be owned");
365timeout, buf_size,
flags)
403memset(&
init, 0,
sizeof(
init));
426x_net_info->external = 0;
427x_net_info->firewall = 0;
428x_net_info->stateless = 0;
429x_net_info->lb_disable = 0;
430x_net_info->http_version = 0;
431x_net_info->http_push_auth = 0;
432x_net_info->http_proxy_leak = 0;
433x_net_info->http_proxy_skip = 0;
434x_net_info->http_proxy_mask = 0;
435x_net_info->user[0] =
'\0';
436x_net_info->pass[0] =
'\0';
437x_net_info->path[0] =
'\0';
438x_net_info->http_proxy_host[0] =
'\0';
439x_net_info->http_proxy_port = 0;
440x_net_info->http_proxy_user[0] =
'\0';
441x_net_info->http_proxy_pass[0] =
'\0';
443 if(x_net_info->http_referer) {
444 free((
void*) x_net_info->http_referer);
445x_net_info->http_referer = 0;
447x_net_info->timeout = timeout;
454memset(&
init, 0,
sizeof(
init));
460&sock, &
init, flgs);
463 stringhostport(net_info->
host);
484timeout, buf_size,
flags)
505 const char* eol = strstr(header,
HTTP_EOL);
509 if(sscanf(header,
"HTTP/%*[0-9.] %u%n", &c, &
n) < 1 || eol < header +
n)
513eol =
str+ (size_t)(eol - header);
515 str+= strspn(
str,
" \t");
517 if(!
isspace((
unsigned char) eol[-1]))
535 const char* user_header,
542 void** user_data_ptr,
544 void* user_data = 0,
553 string(
"CConn_HttpStream::CConn_HttpStream(): ")
554+ (net_info ?
" Out of memory" 555:
" Unable to build connection parameters"));
560 "CConn_HttpStream::CConn_HttpStream(): " 561 " Bad request method (CONNECT)");
564x_net_info->req_method = method;
566x_net_info->http_version = 1;
569 "CConn_HttpStream::CConn_HttpStream(): " 570 " Bad URL \""+
string(url) +
'"');
574 if((
len= *host ? strlen(host) : 0) >=
sizeof(x_net_info->host)) {
576 "CConn_HttpStream::CConn_HttpStream(): " 577 " Host too long \""+
string(host) +
'"');
579memcpy(x_net_info->host, host, ++
len);
582x_net_info->port = port;
585 "CConn_HttpStream::CConn_HttpStream(): " 586 " Path too long \""+
string(path) +
'"');
590 "CConn_HttpStream::CConn_HttpStream(): " 591 " Args too long \""+
string(args) +
'"');
593 if(user_header && *user_header
597 "Cannot set user header",
602 "CConn_HttpStream::CConn_HttpStream(): " 603 " "+
string(msg_ptr.
get()));
606x_net_info->timeout = timeout;
608*user_data_ptr = user_data;
609*user_cleanup_ptr = user_cleanup;
623 const string& user_header,
645m_UserAdjust(0), m_UserParseHeader(0)
672m_UserAdjust(0), m_UserParseHeader(0)
680 const string& user_header,
701m_UserAdjust(0), m_UserParseHeader(0)
709 const string& user_header,
736m_UserAdjust(adjust), m_UserParseHeader(parse_header)
743 const string& user_header,
770m_UserAdjust(adjust), m_UserParseHeader(parse_header)
799 if(http->exceptions())
807 unsigned intfailure_count)
814 if(failure_count == (
unsigned int)(-1) && !http->
m_URL.empty()) {
818http->
m_URL.clear();
825 if(retval < 0 && modified)
828retval = modified ? 1 : -1;
832 if(http->exceptions())
852 const char* user_header,
868 string(
"CConn_ServiceStream::CConn_ServiceStream(): ")
869+ (net_info ?
" Out of memory" 870:
" Unable to build connection parameters"));
872 if(user_header && *user_header
876 "Cannot set user header",
881 "CConn_ServiceStream::CConn_ServiceStream(): " 882 " "+
string(msg_ptr.
get()));
885x_net_info->timeout = timeout;
888memcpy(x_extra, extra,
sizeof(*x_extra));
890memset(x_extra, 0,
sizeof(*x_extra));
897memset(&xx_extra, 0,
sizeof(xx_extra));
898xx_extra.
data= x_data;
899xx_extra.
reset= x_reset;
900xx_extra.
adjust= x_adjust;
926extra && extra->reset
928extra && extra->adjust
933extra && extra->get_next_info
934? sx_GetNextInfo : 0,
944 const string& user_header,
956extra && extra->reset
958extra && extra->adjust
963extra && extra->get_next_info
964? sx_GetNextInfo : 0,
996 if(svc->exceptions())
1004 unsigned intfailure_count)
1011 if(svc->exceptions())
1025 if(svc->exceptions())
1038 if(svc->exceptions())
1103 "CConn_MemoryStream::ToString(NULL) is not allowed");
1106 size_t size= sb && good() ? (size_t)(tellp() - tellg()) : 0;
1110 size_ts = (size_t) sb->sgetn(&(*
str)[0],
size);
1111 #ifdef NCBI_COMPILER_WORKSHOP 1126 "CConn_MemoryStream::ToVector(NULL) is not allowed");
1129 size_t size= sb && good() ? (size_t)(tellp() - tellg()) : 0;
1130vec->resize(
size);
1133 size_ts = (size_t) sb->sgetn(&(*vec)[0],
size);
1134 #ifdef NCBI_COMPILER_WORKSHOP 1155 constvector<string>& args,
1160unique_ptr<CPipe> p(
new CPipe(pipe_size));
1162pipe = c ? p.release() : 0;
1168 constvector<string>& args,
1216 unsigned shortport,
1230memcpy( x_cmcb, cmcb,
sizeof(*x_cmcb));
1231memset(&xx_cmcb, 0,
sizeof(xx_cmcb));
1232xx_cmcb.
data= x_data;
1233xx_cmcb.
func= x_func;
1236memset( x_cmcb, 0,
sizeof(*x_cmcb));
1243timeout = net_info->
timeout;
1245 if(timeout != net_info->
timeout) {
1249 "CConn_FtpStream::CConn_FtpStream(): " 1252xx_net_info->
timeout= timeout;
1253x_net_info = xx_net_info;
1255x_net_info = net_info;
1257 if(x_net_info != net_info)
1280 const string& user,
1281 const string& pass,
1282 const string& path,
1283 unsigned shortport,
1301fConn_Untie | fConn_WriteUnbuffered)
1325fConn_Untie | fConn_WriteUnbuffered)
1347 if(ftp->exceptions())
1357 static charsink[16384];
1374 while(read(sink,
sizeof(sink)))
1385 returnstatus == eIO_Closed ?
eIO_Success: status;
1390 const string&
file,
1391 const string& user,
1392 const string& pass,
1393 const string& path,
1394 unsigned shortport,
1403 if(!
file.empty())
1417 if(net_info.
path[0])
1434write(directory ?
"NLST ":
"RETR ", 5) <<
file<<
'\n';
1443 const string& user,
1444 const string& pass,
1445 const string&
file,
1446 const string& path,
1447 unsigned shortport,
1454 if(!
file.empty())
1466 if(net_info.
path[0])
1508 const char* s =
str.c_str();
1509 if(!
isalpha((
unsigned char)(*s)))
1511 for(++s; *s; ++s) {
1512 if(!
isalnum((
unsigned char)(*s)) && *s !=
'_')
1521 size_t len= url.size();
1542 unsigned shortport;
1544 if(0 < pos && pos <
len- 1
1545&& url[pos - 1] !=
'/'&& (pos == 1 || url[pos - 2] !=
'/')
1556net_info->timeout, buf_size);
1558 switch(net_info->scheme) {
1565 if(*net_info->host || net_info->port) {
1566 ERR_POST_X(18,
Error<<
"The limited implementation of the file:// scheme does not" 1567 " support non-empty authority portion of the URL (local files only!)");
1570 _ASSERT(!*net_info->user && !*net_info->pass);
1571 if(net_info->debug_printout) {
1574net_info->external = 0;
1575net_info->firewall = 0;
1576net_info->stateless = 0;
1577net_info->lb_disable = 0;
1578net_info->http_version = 0;
1579net_info->http_push_auth = 0;
1580net_info->http_proxy_leak = 0;
1581net_info->http_proxy_skip = 0;
1582net_info->http_proxy_mask = 0;
1583net_info->http_proxy_host[0] =
'\0';
1584net_info->http_proxy_port = 0;
1585net_info->http_proxy_user[0] =
'\0';
1586net_info->http_proxy_pass[0] =
'\0';
1587net_info->max_try = 0;
1590 if(net_info->http_referer) {
1591 free((
void*) net_info->http_referer);
1592net_info->http_referer = 0;
1600 if(!net_info->user[0]) {
1601strcpy(net_info->user,
"ftp");
1602 if(!net_info->pass[0])
1603strcpy(net_info->pass,
"-none@");
1606net_info->timeout, buf_size);
Helper hook-up class that installs default logging/registry/locking (but only if they have not yet be...
CConn_FtpStream specialization (ctor) for download.
CConn_FileStream(const string &ifname, const string &ofname=kEmptyStr, SFILE_ConnAttr *attr=0)
CConn_FtpStream is an elaborate FTP client, can be used for data downloading and/or uploading to and ...
Helper base class for HTTP-like streams.
This stream exchanges data with an HTTP server located at the URL: http[s]://host[:port]/path[?...
Helper class to build streams on top of CONNECTOR (internal use only).
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.
EIO_Status Fetch(const STimeout *timeout)
EIO_Status Pushback(const CT_CHAR_TYPE *data, streamsize size, bool push)
Push the specified data "data" of size "size" back into the underlying connection CONN.
Interface for testing cancellation request in a long lasting operation.
static void cleanup(void)
static CS_CONNECTION * conn
static void DLIST_NAME() init(DLIST_LIST_TYPE *list)
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
static const char * str(char *buf, int n)
static const struct type types[]
element_type * get(void) const
Get pointer.
unique_ptr< T, TDeleter > make_c_unique(T *p, TDeleter d)
Eliminates the necessity for specifying types of both allocated resource and deallocating C function.
@ eTakeOwnership
An object can take ownership of another.
@ eNoOwnership
No ownership is assumed.
CConn_MemoryStream(size_t buf_size=kConn_DefaultBufSize)
EIO_Status Fetch(const STimeout *timeout=kDefaultTimeout)
Flush the stream and fetch the response (w/o extracting any user data)
void ToVector(vector< char > *)
fill in the data, NULL is not accepted
static int sx_Adjust(SConnNetInfo *net_info, void *data, unsigned int count)
static void sx_Cleanup(void *data)
virtual ~CConn_MemoryStream()
CConn_IOStream(CONN conn, bool close=false, const STimeout *timeout=kDefaultTimeout, size_t buf_size=kConn_DefaultBufSize, TConn_Flags flags=0, CT_CHAR_TYPE *ptr=0, size_t size=0)
Create a stream based on CONN, which is to be closed upon stream dtor but only if "close" parameter i...
static void sx_Cleanup(void *data)
static const SSERV_Info * sx_GetNextInfo(void *data, SERV_ITER iter)
void x_InitDownload(const string &file, Uint8 offset)
EIO_Status Wait(EIO_Event event, const STimeout *timeout=&kZeroTimeout)
Equivalent to CONN_Wait(GetCONN(), event, timeout)
virtual EIO_Status Close(void)
Close CONNection, free all internal buffers and underlying structures, and render the stream unusable...
const STimeout * GetTimeout(EIO_Event direction) const
virtual EIO_Status Drain(const STimeout *timeout=kDefaultTimeout)
Abort any command in progress, read and discard all input data, and clear stream error state when suc...
CConn_ServiceStream(const string &service, TSERV_Type types=fSERV_Any, const SConnNetInfo *net_info=0, const SSERVICE_Extra *extra=0, const STimeout *timeout=kDefaultTimeout, size_t buf_size=kConn_DefaultBufSize)
SHTTP_StatusData m_StatusData
void ToString(string *)
The CConnMemoryStream::To* methods allow to obtain unread portion of the stream into a single contain...
CConn_NamedPipeStream(const string &pipename, size_t pipesize=0, const STimeout *timeout=kDefaultTimeout, size_t buf_size=kConn_DefaultBufSize)
static const STimeout kZeroTimeout
Polling timeout with the 0.0 time in it.
virtual ~CConn_HttpStream()
static EIO_Status sx_FtpCallback(void *data, const char *cmd, const char *arg)
CConn_SocketStream(const string &host, unsigned short port, unsigned short max_try, const STimeout *timeout=kDefaultTimeout, size_t buf_size=kConn_DefaultBufSize, TConn_Flags flags=0)
Create a direct connection with host:port.
EIO_Status SetCanceledCallback(const ICanceled *canceled)
Cancellation support.
FHTTP_Adjust m_UserAdjust
virtual ~CConn_PipeStream()
static void sx_Reset(void *data)
virtual ~CConn_IOStream()
CConn_PipeStream(const string &cmd, const vector< string > &args, CPipe::TCreateFlags flags=0, size_t pipe_size=0, const STimeout *timeout=kDefaultTimeout, size_t buf_size=kConn_DefaultBufSize)
EIO_Status SetTimeout(EIO_Event direction, const STimeout *timeout) const
Set connection timeout for "direction".
string GetType(void) const
CConn_FTPDownloadStream(const string &host, const string &file=kEmptyStr, const string &user="ftp", const string &pass="-none@", const string &path=kEmptyStr, unsigned short port=0, TFTP_Flags flag=0, const SFTP_Callback *cmcb=0, Uint8 offset=0, const STimeout *timeout=kDefaultTimeout, size_t buf_size=kConn_DefaultBufSize)
EIO_Status Status(EIO_Event direction=eIO_Close) const
void x_InitUpload(const string &file, Uint8 offset)
CConn_FTPUploadStream(const string &host, const string &user, const string &pass, const string &file=kEmptyStr, const string &path=kEmptyStr, unsigned short port=0, TFTP_Flags flag=0, Uint8 offset=0, const STimeout *timeout=kDefaultTimeout)
CConn_FtpStream(const string &host, const string &user, const string &pass, const string &path=kEmptyStr, unsigned short port=0, TFTP_Flags flag=0, const SFTP_Callback *cmcb=0, const STimeout *timeout=kDefaultTimeout, size_t buf_size=kConn_DefaultBufSize)
CConn_HttpStream(const string &host, const string &path, const string &args=kEmptyStr, const string &user_header=kEmptyStr, unsigned short port=0, THTTP_Flags flags=fHTTP_AutoReconnect, const STimeout *timeout=kDefaultTimeout, size_t buf_size=kConn_DefaultBufSize)
SOCK GetSOCK(void)
Get underlying SOCK, if available (e.g. after Fetch())
EIO_Status x_Pushback(const CT_CHAR_TYPE *data, streamsize size, bool push=false)
CConn_IOStream * NcbiOpenURL(const string &url, size_t buf_size)
Given a URL, open the data source and make it available for _reading_.
static EHTTP_HeaderParse sx_ParseHeader(const char *header, void *data, int code)
const void * m_Ptr
pointer to read memory area (if owned)
FHTTP_Cleanup m_UserCleanup
virtual ~CConn_ServiceStream()
EHTTP_HeaderParse Parse(const char *header)
FHTTP_ParseHeader m_UserParseHeader
virtual ~CConn_FtpStream()
string GetDescription(void) const
CPipe * m_Pipe
Underlying pipe.
unique_ptr< CConn_Streambuf > x_CSb
static int sx_Adjust(SConnNetInfo *net_info, void *data, unsigned int count)
static EHTTP_HeaderParse sx_ParseHeader(const char *header, void *data, int code)
unsigned int TConn_Flags
bitwise OR of EConn_Flag
int m_ExitCode
Process exit code.
CConstIRef< ICanceled > m_Canceled
virtual EIO_Status Close(void)
Close CONNection, free all internal buffers and underlying structures, and render the stream unusable...
BUF GetBUF(void)
Get the underlying BUF handle (it still remains managed by the stream)
static EIO_Status sx_IsCanceled(CONN conn, TCONN_Callback type, void *data)
@ fConn_Untie
do not flush before reading
CONNECTOR MEMORY_CreateConnector(void)
CONNECTOR SOCK_CreateConnectorEx(const char *host, unsigned short port, unsigned short max_try, const void *data, size_t size, TSOCK_Flags flags)
CONNECTOR NAMEDPIPE_CreateConnector(const string &pipename, size_t pipesize=0)
Create CNamedPipe-based CONNECTOR.
CONNECTOR SERVICE_CreateConnectorEx(const char *service, TSERV_Type types, const SConnNetInfo *net_info, const SSERVICE_Extra *extra)
EIO_Status HTTP_CreateTunnel(const SConnNetInfo *net_info, THTTP_Flags flags, SOCK *sock)
Same as HTTP_CreateTunnelEx(net_info, flags, 0, 0, 0, 0, sock)
CONNECTOR PIPE_CreateConnector(const string &cmd, const vector< string > &args, CPipe::TCreateFlags flags=0, CPipe *pipe=0, EOwnership own_pipe=eTakeOwnership, size_t pipe_size=0)
Create CPipe-based CONNECTOR.
CONNECTOR FTP_CreateConnectorSimple(const char *host, unsigned short port, const char *user, const char *pass, const char *path, TFTP_Flags flag, const SFTP_Callback *cmcb)
CONNECTOR FILE_CreateConnectorEx(const char *ifname, const char *ofname, const SFILE_ConnAttr *attr)
CONNECTOR MEMORY_CreateConnectorEx(BUF buf, unsigned int own_buf)
CONNECTOR HTTP_CreateConnectorEx(const SConnNetInfo *net_info, THTTP_Flags flags, FHTTP_ParseHeader parse_header, void *user_data, FHTTP_Adjust adjust, FHTTP_Cleanup cleanup)
Create new CONNECTOR structure to hit the specified URL using HTTP with either POST / GET (or ANY) me...
CONNECTOR SOCK_CreateConnectorOnTop(SOCK sock, unsigned short own_sock)
void(* FSERVICE_Reset)(void *data)
EIO_Status CONN_Read(CONN conn, void *buf, size_t size, size_t *n_read, EIO_ReadMethod how)
unsigned int THTTP_Flags
Bitwise OR of EHTTP_Flag.
EIO_Status CONN_SetCallback(CONN conn, ECONN_Callback type, const SCONN_Callback *new_cb, SCONN_Callback *old_cb)
int(* FHTTP_Adjust)(SConnNetInfo *net_info, void *user_data, unsigned int failure_count)
unsigned int TCONN_Callback
EIO_Status CONN_Write(CONN conn, const void *buf, size_t size, size_t *n_written, EIO_WriteMethod how)
void(* FHTTP_Cleanup)(void *user_data)
FHTTP_ParseHeader parse_header
const SSERV_Info *(* FSERVICE_GetNextInfo)(void *data, SERV_ITER iter)
EIO_Status(* FFTP_Callback)(void *data, const char *cmd, const char *arg)
void * data
data to pass to the callback as its last arg
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".
CONNECTOR FTP_CreateConnector(const SConnNetInfo *info, TFTP_Flags flag, const SFTP_Callback *cmcb)
char * CONN_Description(CONN conn)
Return a human-readable description of the connection as a character '\0'-terminated string.
FSERVICE_GetNextInfo get_next_info
CONNECTOR SOCK_CreateConnector(const char *host, unsigned short port, unsigned short max_try)
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...
void * handle
data handle of the connector
const char * CONN_GetType(CONN conn)
Get verbal representation of connection type as a character string.
EHTTP_HeaderParse(* FHTTP_ParseHeader)(const char *http_header, void *user_data, int server_error)
EIO_Status CONN_GetSOCK(CONN conn, SOCK *sock)
Get an underlying SOCK handle for connection that is implemented as a socket.
const STimeout * CONN_GetTimeout(CONN conn, EIO_Event event)
Retrieve current timeout, return NULL(kInfiniteTimeout) if it is infinite.
void(* FSERVICE_Cleanup)(void *data)
CONNECTOR SOCK_CreateConnectorOnTopEx(SOCK sock, unsigned short own_sock, const char *hostport)
FCONN_Callback func
function address to call on the event
@ eCONN_OnFlush
About to be flushed (NB: == eIO_ReadWrite)
@ eCONN_OnWrite
Write to CONNECTOR is about to occur.
@ eCONN_OnRead
Read from CONNECTOR is about to occur.
@ eCONN_OnOpen
Call prior to open (NB: "conn" still closed)
@ fHTTP_NoAutoRetry
No auto-retries allowed.
@ fHTTP_AutoReconnect
See HTTP_CreateConnectorEx()
@ eHTTP_HeaderSuccess
Parse succeeded, retain server status.
@ eHTTP_HeaderError
Parse failed, treat as a server error.
#define ERR_POST_X(err_subcode, message)
Error posting with default error code and given error subcode.
void Error(CExceptionArgs_Base &args)
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
#define THROW1_TRACE(exception_class, exception_arg)
Throw trace.
#define NCBI_CATCH_ALL(message)
This macro is deprecated - use *_X or *_XX variant instead of it.
void Reset(void)
Reset reference object.
bool NotNull(void) const THROWS_NONE
Check if pointer is not null â same effect as NotEmpty().
unsigned int TCreateFlags
bitwise OR of "ECreateFlag"
EIO_Status Close(int *exitcode=0)
Close pipe.
uint64_t Uint8
8-byte (64-bit) unsigned integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
unsigned int TSERV_Type
Bitwise OR of ESERV_Type[Special].
@ fSERV_DelayOpen
Don't open service until use.
EOwnership SetOwnership(EOwnership if_to_own)
Specify if this "CSocket" is to own the underlying "SOCK".
EIO_Status SOCK_Close(SOCK sock)
Close the SOCK handle, and destroy all relevant internal data.
SOCK GetSOCK(void) const
Access to the underlying "SOCK".
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...
void Reset(SOCK sock, EOwnership if_to_own, ECopyTimeout whence)
Close the current underlying "SOCK" (if any, and if owned), and from now on use "sock" as the underly...
EIO_Status SOCK_Abort(SOCK sock)
If there is outstanding connection or output data pending, cancel it.
unsigned int TSOCK_Flags
bitwise "OR" of ESOCK_Flags
IO_PREFIX::iostream CNcbiIostream
Portable alias for iostream.
NCBI_NS_STD::string::size_type SIZE_TYPE
static bool EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)
Check if a string ends with a specified suffix value.
CTempString & assign(const char *src_str, size_type len)
Assign new values to the content of the a string.
static SIZE_TYPE Find(const CTempString str, const CTempString pattern, ECase use_case=eCase, EDirection direction=eForwardSearch, SIZE_TYPE occurrence=0)
Find the pattern in the string.
static string UIntToString(unsigned int value, TNumToStringFlags flags=0, int base=10)
Convert UInt to string.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
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 unsigned int StringToUInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to unsigned int.
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 UInt8ToString(Uint8 value, TNumToStringFlags flags=0, int base=10)
Convert UInt8 to string.
@ fConvErr_NoThrow
Do not throw an exception on error.
@ eNocase
Case insensitive compare.
char http_proxy_host[255+1]
unsigned short http_proxy_port
int ConnNetInfo_OverrideUserHeader(SConnNetInfo *net_info, const char *header)
int ConnNetInfo_ParseURL(SConnNetInfo *net_info, const char *url)
int ConnNetInfo_SetArgs(SConnNetInfo *net_info, const char *args)
SConnNetInfo * ConnNetInfo_Clone(const SConnNetInfo *net_info)
LOG CORE_GetLOG(void)
Get the log handle that is to be used by the core internals (CORE LOG).
int ConnNetInfo_SetUserHeader(SConnNetInfo *net_info, const char *header)
enum ENcbiOwnership EOwnership
Ownership relations between objects.
void ConnNetInfo_Log(const SConnNetInfo *net_info, ELOG_Level sev, LOG log)
EBProxyType http_proxy_mask
SConnNetInfo * ConnNetInfo_Create(const char *service)
const char * NcbiMessagePlusError(int *dynamic, const char *message, int error, const char *descr)
Add current "error" (and maybe its description) to the message: <message>[ {error=[[<error>][,...
EIO_Event
I/O event (or direction).
EBDebugPrintout debug_printout
int ConnNetInfo_SetPath(SConnNetInfo *net_info, const char *path)
void ConnNetInfo_Destroy(SConnNetInfo *net_info)
@ 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)
@ fProxy_Http
$http_proxy used
@ eIO_ReadPlain
read readily available data only, wait if none
@ eIO_ReadPersist
read exactly as much as requested, w/waits
@ eIO_WritePersist
write exactly as much as specified, w/waits
@ eIO_ReadWrite
eIO_Read | eIO_Write (also, eCONN_OnFlush)
@ eIO_Close
also serves as an error indicator in SOCK_Poll
unsigned int
A callback function used to compare two keys in a database.
Definition of all error codes used in connect library (xconnect.lib, xconnext.lib etc).
static void text(MDB_val *v)
const struct ncbi::grid::netcache::search::fields::SIZE size
int NCBI_HasSpaces(const char *s, size_t n)
Return non-zero(true) if a block of memory based at "s" and of size "n" has any space characters (as ...
static CConn_IOStream::TConnector s_ServiceConnectorBuilder(const char *service, TSERV_Type types, const SConnNetInfo *net_info, const char *user_header, const SSERVICE_Extra *extra, void *x_data, SSERVICE_Extra *x_extra, FSERVICE_Reset x_reset, FHTTP_Adjust x_adjust, FSERVICE_Cleanup x_cleanup, FHTTP_ParseHeader x_parse_header, FSERVICE_GetNextInfo x_get_next_info, const STimeout *timeout)
AutoPtr< char, CDeleter< char > > TTempCharPtr
static CConn_IOStream::TConnector s_PipeConnectorBuilder(const string &cmd, const vector< string > &args, CPipe::TCreateFlags flgs, size_t pipe_size, CPipe *&pipe)
static CConn_IOStream::TConnector s_FtpConnectorBuilder(const char *host, unsigned short port, const char *user, const char *pass, const char *path, const SConnNetInfo *net_info, TFTP_Flags flgs, const SFTP_Callback *cmcb, void *x_data, SFTP_Callback *x_cmcb, FFTP_Callback x_func, const STimeout *timeout)
static CConn_IOStream::TConnector s_HttpConnectorBuilder(const SConnNetInfo *net_info, EReqMethod method, const char *url, const char *host, unsigned short port, const char *path, const char *args, const char *user_header, void *x_data, FHTTP_Adjust x_adjust, FHTTP_Cleanup x_cleanup, FHTTP_ParseHeader x_parse_header, THTTP_Flags flgs, const STimeout *timeout, void **user_data_ptr, FHTTP_Cleanup *user_cleanup_ptr, void *user_data=0, FHTTP_Cleanup user_cleanup=0)
static SOCK s_GrabSOCK(CSocket &socket)
static CConn_IOStream::TConnector s_SocketConnectorBuilder(const string &ahost, unsigned short aport, unsigned short max_try, const void *data, size_t size, TSOCK_Flags flgs)
static bool x_IsIdentifier(const string &str)
SConnNetInfo * ConnNetInfo_CreateInternal(const char *service)
char * SERV_ServiceName(const char *service)
EIO_Status SOCK_CreateOnTopInternal(const void *handle, size_t handle_size, SOCK *sock, const SSOCK_Init *init, TSOCK_Flags flags)
EIO_Status SOCK_CreateInternal(const char *host, unsigned short port, const STimeout *timeout, SOCK *sock, const SSOCK_Init *init, TSOCK_Flags flags)
static void Delete(SConnNetInfo *net_info)
Functor template for deleting object.
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