NCBI C++ ToolKit
Macros | Typedefs | Enumerations | Functions | Variables
ncbi_connutil.c File Reference
#include "ncbi_ansi_ext.h"
#include "ncbi_connssl.h"
#include "ncbi_once.h"
#include "ncbi_servicep.h"
#include <connect/ncbi_connutil.h>
#include <ctype.h>
#include <errno.h>
#include <stdlib.h>
+ Include dependency graph for ncbi_connutil.c:

Go to the source code of this file.

Go to the SVN repository for this file.

Macros

#define NCBI_USE_ERRCODE_X   Connect_Util
 
#define CONN_NET_INFO_MAGIC   0x600DCAFE
 
#define SizeOf(arr)   (sizeof(arr) / sizeof((arr)[0]))
 
#define x_getenv   getenv
 
#define REG_VALUE(name, value, def_value)
 
#define VALID_URL_SYMBOL(ch)   (s_EncodeTable[(unsigned char)ch][0] != '%')
 

Typedefs

typedef int(* FStrNCmp) (const char *s1, const char *s2, size_t n)
 
typedef EIO_Status(* FDoIO) (void *stream, void *buf, size_t size, size_t *n_read, EIO_Event what)
 

Enumerations

enum  EUserHeaderOp { eUserHeaderOp_Delete = 0 , eUserHeaderOp_Extend , eUserHeaderOp_Override , eUserHeaderOp_PreOverride }
 

Functions

static int x_StrcatCRLF (char **dstp, const char *src, int pre)
 
static const char * x_strncpy0 (char *dst, const char *src, size_t dst_size)
 
static int x_mkenv (char *str, size_t len)
 
static const char * x_GetValue (const char *svc, size_t svclen, const char *param, char *value, size_t value_size, const char *def_value, int *generic, FStrNCmp strncompar)
 
static void x_Trim (char *str)
 
static const char * s_GetValue (const char *svc, size_t svclen, const char *param, char *value, size_t value_size, const char *def_value, int *generic, FStrNCmp strncompar)
 
const char * ConnNetInfo_GetValueInternal (const char *service, const char *param, char *value, size_t value_size, const char *def_value)
 
const char * ConnNetInfo_GetValueService (const char *service, const char *param, char *value, size_t value_size, const char *def_value)
 
const char * ConnNetInfo_GetValue (const char *service, const char *param, char *value, size_t value_size, const char *def_value)
 
int ConnNetInfo_Boolean (const char *str)
 
static EURLScheme x_ParseScheme (const char *str, size_t len)
 
static EFWMode x_ParseFirewall (const char *str, int generic)
 
static const char * x_ProxyStr (EBProxyType proxy)
 
static int x_SetupHttpProxy (SConnNetInfo *info, const char *env, EBProxyType proxy)
 
static int x_SetupSystemHttpProxy (SConnNetInfo *info)
 
static const char * x_GetReferer (char *str, size_t size)
 
static void x_DestroyNetInfo (SConnNetInfo *info, unsigned int magic)
 
static int s_InfoIsValid (const SConnNetInfo *info)
 
static int x_SetArgs (SConnNetInfo *info, const char *args)
 
SConnNetInfoConnNetInfo_CreateInternal (const char *service)
 
void ConnNetInfo_ResetHttpProxyInternal (void)
 
SConnNetInfoConnNetInfo_Create (const char *service)
 
int ConnNetInfo_SetUserHeader (SConnNetInfo *info, const char *user_header)
 
int ConnNetInfo_AppendUserHeader (SConnNetInfo *info, const char *user_header)
 
int ConnNetInfo_PrependUserHeader (SConnNetInfo *info, const char *user_header)
 
static int x_TagValueMatches (const char *oldval, size_t oldvallen, const char *newval, size_t newvallen)
 
static int s_ModifyUserHeader (SConnNetInfo *info, const char *user_header, enum EUserHeaderOp op)
 
int ConnNetInfo_OverrideUserHeader (SConnNetInfo *info, const char *header)
 
int ConnNetInfo_PreOverrideUserHeader (SConnNetInfo *info, const char *header)
 
int ConnNetInfo_ExtendUserHeader (SConnNetInfo *info, const char *header)
 
void ConnNetInfo_DeleteUserHeader (SConnNetInfo *info, const char *header)
 
int ConnNetInfo_ParseURL (SConnNetInfo *info, const char *url)
 
static const char * x_SepAndLen (const char *str, const char *sep, size_t *len)
 
int ConnNetInfo_SetPath (SConnNetInfo *info, const char *path)
 
int ConnNetInfo_AddPath (SConnNetInfo *info, const char *path)
 
int ConnNetInfo_SetArgs (SConnNetInfo *info, const char *args)
 
int ConnNetInfo_SetFrag (SConnNetInfo *info, const char *frag)
 
const char * ConnNetInfo_GetArgs (const SConnNetInfo *info)
 
static int x_AppendArg (SConnNetInfo *info, const char *arg, const char *val)
 
int ConnNetInfo_AppendArg (SConnNetInfo *info, const char *arg, const char *val)
 
static int x_PrependArg (SConnNetInfo *info, const char *arg, const char *val)
 
int ConnNetInfo_PrependArg (SConnNetInfo *info, const char *arg, const char *val)
 
static int x_DeleteArg (SConnNetInfo *info, const char *arg)
 
int ConnNetInfo_DeleteArg (SConnNetInfo *info, const char *arg)
 
static void x_DeleteAllArgs (SConnNetInfo *info, const char *args)
 
void ConnNetInfo_DeleteAllArgs (SConnNetInfo *info, const char *args)
 
int ConnNetInfo_PreOverrideArg (SConnNetInfo *info, const char *arg, const char *val)
 
int ConnNetInfo_PostOverrideArg (SConnNetInfo *info, const char *arg, const char *val)
 
static int x_IsSufficientAddress (const char *addr)
 
static const char * x_ClientAddress (const char *client_host, int local_host)
 
int ConnNetInfo_SetupStandardArgs (SConnNetInfo *info, const char *service)
 
SConnNetInfoConnNetInfo_CloneInternal (const SConnNetInfo *info)
 
SConnNetInfoConnNetInfo_Clone (const SConnNetInfo *info)
 
static const char * x_BadMagic (unsigned int magic, char buf[])
 
static const char * x_Num (unsigned int num, char buf[])
 
static const char * x_Scheme (EURLScheme scheme, char buf[])
 
static const char * x_Port (unsigned short port, char buf[])
 
static const char * x_ReqMethod (TReqMethod req_method, char buf[])
 
static const char * x_Firewall (unsigned int firewall)
 
static const char * x_CredInfo (NCBI_CRED cred, char buf[])
 
static void s_SaveStringQuot (char *s, const char *name, const char *str, int quote)
 
static void s_SaveString (char *s, const char *name, const char *str)
 
static void s_SaveKeyval (char *s, const char *name, const char *str)
 
static void s_SaveBool (char *s, const char *name, unsigned int bbb)
 
static void s_SaveULong (char *s, const char *name, unsigned long lll)
 
static void s_SaveUserHeader (char *s, const char *name, const char *uh, size_t uhlen)
 
void ConnNetInfo_Log (const SConnNetInfo *info, ELOG_Level sev, LOG lg)
 
char * ConnNetInfo_URL (const SConnNetInfo *info)
 
int ConnNetInfo_SetTimeout (SConnNetInfo *info, const STimeout *timeout)
 
void ConnNetInfo_Destroy (SConnNetInfo *info)
 
static EIO_Status x_URLConnectErrorReturn (SOCK sock, EIO_Status status)
 
EIO_Status URL_ConnectEx (const char *host, unsigned short port, const char *path, const char *args, TReqMethod req_method, size_t content_length, const STimeout *o_timeout, const STimeout *rw_timeout, const char *user_hdr, SURLExtra *extra, TSOCK_Flags flags, SOCK *sock)
 
SOCK URL_Connect (const char *host, unsigned short port, const char *path, const char *args, EReqMethod req_method, size_t content_length, const STimeout *o_timeout, const STimeout *rw_timeout, const char *user_hdr, int encode_args, TSOCK_Flags flags)
 
static EIO_Status s_StripToPattern (void *stream, FDoIO io_func, const void *pattern, size_t pattern_size, BUF *discard, size_t *n_discarded)
 
static EIO_Status s_CONN_IO (void *stream, void *buf, size_t size, size_t *n_read, EIO_Event what)
 
EIO_Status CONN_StripToPattern (CONN conn, const void *pattern, size_t pattern_size, BUF *discard, size_t *n_discarded)
 Discard all input data before (and including) the first occurrence of a "pattern". More...
 
static EIO_Status s_SOCK_IO (void *stream, void *buf, size_t size, size_t *n_read, EIO_Event what)
 
EIO_Status SOCK_StripToPattern (SOCK sock, const void *pattern, size_t pattern_size, BUF *discard, size_t *n_discarded)
 
static EIO_Status s_BUF_IO (void *stream, void *buf, size_t size, size_t *n_read, EIO_Event what)
 
EIO_Status BUF_StripToPattern (BUF buffer, const void *pattern, size_t pattern_size, BUF *discard, size_t *n_discarded)
 
static int s_HexChar (char ch)
 
int URL_DecodeEx (const void *src_buf, size_t src_size, size_t *src_read, void *dst_buf, size_t dst_size, size_t *dst_written, const char *allow_symbols)
 
int URL_Decode (const void *src_buf, size_t src_size, size_t *src_read, void *dst_buf, size_t dst_size, size_t *dst_written)
 
void URL_EncodeEx (const void *src_buf, size_t src_size, size_t *src_read, void *dst_buf, size_t dst_size, size_t *dst_written, const char *allow_symbols)
 
void URL_Encode (const void *src_buf, size_t src_size, size_t *src_read, void *dst_buf, size_t dst_size, size_t *dst_written)
 
char * MIME_ComposeContentTypeEx (EMIME_Type type, EMIME_SubType subtype, EMIME_Encoding encoding, char *buf, size_t bufsize)
 
int MIME_ParseContentTypeEx (const char *str, EMIME_Type *type, EMIME_SubType *subtype, EMIME_Encoding *encoding)
 
void SERV_InitFirewallPorts (void)
 
int SERV_AddFirewallPort (unsigned short port)
 
int SERV_IsFirewallPort (unsigned short port)
 
void SERV_PrintFirewallPorts (char *buf, size_t bufsize, EFWMode mode)
 

Variables

static const char kDigits [] = "0123456789"
 
const STimeout g_NcbiDefConnTimeout
 DEF_CONN_TIMEOUT as STimeout. More...
 
static TNCBI_BigCount s_FWPorts [1024/sizeof(TNCBI_BigCount)] = { 0 }
 
static const char s_EncodeTable [256][4]
 
static const char * kMIME_Type [eMIME_T_Unknown+1]
 
static const char * kMIME_SubType [eMIME_Unknown+1]
 
static const char * kMIME_Encoding [eENCOD_Unknown+1]
 

Macro Definition Documentation

◆ CONN_NET_INFO_MAGIC

#define CONN_NET_INFO_MAGIC   0x600DCAFE

Definition at line 46 of file ncbi_connutil.c.

◆ NCBI_USE_ERRCODE_X

#define NCBI_USE_ERRCODE_X   Connect_Util

Definition at line 43 of file ncbi_connutil.c.

◆ REG_VALUE

#define REG_VALUE (   name,
  value,
  def_value 
)
Value:
generic = 0; \
*value = '\0'; \
if (!s_GetValue(service, len, \
name, value, sizeof(value), def_value, \
&generic, strncmp)) \
goto err/*memory or truncation error*/
int len
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
int strncmp(const char *str1, const char *str2, size_t count)
Definition: odbc_utils.hpp:133
static const char * s_GetValue(const char *svc, size_t svclen, const char *param, char *value, size_t value_size, const char *def_value, int *generic, FStrNCmp strncompar)

◆ SizeOf

#define SizeOf (   arr)    (sizeof(arr) / sizeof((arr)[0]))

Definition at line 48 of file ncbi_connutil.c.

◆ VALID_URL_SYMBOL

#define VALID_URL_SYMBOL (   ch)    (s_EncodeTable[(unsigned char)ch][0] != '%')

Definition at line 3131 of file ncbi_connutil.c.

◆ x_getenv

#define x_getenv   getenv

Definition at line 74 of file ncbi_connutil.c.

Typedef Documentation

◆ FDoIO

typedef EIO_Status(* FDoIO) (void *stream, void *buf, size_t size, size_t *n_read, EIO_Event what)

Definition at line 2816 of file ncbi_connutil.c.

◆ FStrNCmp

typedef int(* FStrNCmp) (const char *s1, const char *s2, size_t n)

Definition at line 167 of file ncbi_connutil.c.

Enumeration Type Documentation

◆ EUserHeaderOp

Enumerator
eUserHeaderOp_Delete 
eUserHeaderOp_Extend 
eUserHeaderOp_Override 
eUserHeaderOp_PreOverride 

Definition at line 1069 of file ncbi_connutil.c.

Function Documentation

◆ ConnNetInfo_CloneInternal()

SConnNetInfo* ConnNetInfo_CloneInternal ( const SConnNetInfo info)

◆ ConnNetInfo_CreateInternal()

SConnNetInfo* ConnNetInfo_CreateInternal ( const char *  service)

Definition at line 760 of file ncbi_connutil.c.

References assert, CONN_NET_INFO_MAGIC, CONN_PATH_LEN, ConnNetInfo_Boolean(), CORE_LOGF_X, DEF_CONN_ARGS, DEF_CONN_DEBUG_PRINTOUT, DEF_CONN_EXTERNAL, DEF_CONN_FIREWALL, DEF_CONN_HOST, DEF_CONN_HTTP_PROXY_HOST, DEF_CONN_HTTP_PROXY_LEAK, DEF_CONN_HTTP_PROXY_PASS, DEF_CONN_HTTP_PROXY_PORT, DEF_CONN_HTTP_PROXY_SKIP, DEF_CONN_HTTP_PROXY_USER, DEF_CONN_HTTP_PUSH_AUTH, DEF_CONN_HTTP_USER_HEADER, DEF_CONN_HTTP_VERSION, DEF_CONN_LB_DISABLE, DEF_CONN_MAX_TRY, DEF_CONN_PASS, DEF_CONN_PATH, DEF_CONN_PORT, DEF_CONN_REQ_METHOD, DEF_CONN_STATELESS, DEF_CONN_USER, eDebugPrintout_Data, eDebugPrintout_None, eDebugPrintout_Some, eLOG_Error, eLOG_Warning, eReqMethod_Any, eReqMethod_Get, eReqMethod_Post, eURL_Unspec, fProxy_None, g_NcbiDefConnTimeout, info, int, kInfiniteTimeout, len, malloc(), NCBI_HasSpaces(), NCBI_simple_atof(), REG_CONN_ARGS, REG_CONN_DEBUG_PRINTOUT, REG_CONN_EXTERNAL, REG_CONN_FIREWALL, REG_CONN_HOST, REG_CONN_HTTP_PROXY_HOST, REG_CONN_HTTP_PROXY_LEAK, REG_CONN_HTTP_PROXY_PASS, REG_CONN_HTTP_PROXY_PORT, REG_CONN_HTTP_PROXY_SKIP, REG_CONN_HTTP_PROXY_USER, REG_CONN_HTTP_PUSH_AUTH, REG_CONN_HTTP_USER_HEADER, REG_CONN_HTTP_VERSION, REG_CONN_LB_DISABLE, REG_CONN_MAX_TRY, REG_CONN_PASS, REG_CONN_PATH, REG_CONN_PORT, REG_CONN_REQ_METHOD, REG_CONN_STATELESS, REG_CONN_TIMEOUT, REG_CONN_USER, REG_VALUE, str(), strcasecmp, strncasecmp, val, x_DestroyNetInfo(), x_GetReferer(), x_ParseFirewall(), x_SetArgs(), x_SetupSystemHttpProxy(), and x_StrcatCRLF().

Referenced by ConnNetInfo_Create(), NcbiOpenURL(), s_CreateConnector(), s_CreateHttpConnector(), s_HttpConnectorBuilder(), and SERVICE_CreateConnectorEx().

◆ ConnNetInfo_GetValueInternal()

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

◆ ConnNetInfo_GetValueService()

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

◆ ConnNetInfo_ResetHttpProxyInternal()

void ConnNetInfo_ResetHttpProxyInternal ( void  )

Definition at line 983 of file ncbi_connutil.c.

References x_SetupSystemHttpProxy().

◆ s_BUF_IO()

static EIO_Status s_BUF_IO ( void *  stream,
void *  buf,
size_t  size,
size_t *  n_read,
EIO_Event  what 
)
static

◆ s_CONN_IO()

static EIO_Status s_CONN_IO ( void *  stream,
void *  buf,
size_t  size,
size_t *  n_read,
EIO_Event  what 
)
static

◆ s_GetValue()

static const char* s_GetValue ( const char *  svc,
size_t  svclen,
const char *  param,
char *  value,
size_t  value_size,
const char *  def_value,
int generic,
FStrNCmp  strncompar 
)
static

◆ s_HexChar()

static int s_HexChar ( char  ch)
static

Definition at line 3084 of file ncbi_connutil.c.

References int.

Referenced by URL_DecodeEx().

◆ s_InfoIsValid()

static int s_InfoIsValid ( const SConnNetInfo info)
static

◆ s_ModifyUserHeader()

static int s_ModifyUserHeader ( SConnNetInfo info,
const char *  user_header,
enum EUserHeaderOp  op 
)
static

◆ s_SaveBool()

static void s_SaveBool ( char *  s,
const char *  name,
unsigned int  bbb 
)
static

Definition at line 2259 of file ncbi_connutil.c.

References s_SaveKeyval().

Referenced by ConnNetInfo_Log().

◆ s_SaveKeyval()

static void s_SaveKeyval ( char *  s,
const char *  name,
const char *  str 
)
static

Definition at line 2253 of file ncbi_connutil.c.

References assert, s_SaveStringQuot(), and str().

Referenced by ConnNetInfo_Log(), and s_SaveBool().

◆ s_SaveString()

static void s_SaveString ( char *  s,
const char *  name,
const char *  str 
)
static

Definition at line 2248 of file ncbi_connutil.c.

References s_SaveStringQuot(), and str().

Referenced by ConnNetInfo_Log().

◆ s_SaveStringQuot()

static void s_SaveStringQuot ( char *  s,
const char *  name,
const char *  str,
int  quote 
)
static

Definition at line 2239 of file ncbi_connutil.c.

References str().

Referenced by s_SaveKeyval(), and s_SaveString().

◆ s_SaveULong()

static void s_SaveULong ( char *  s,
const char *  name,
unsigned long  lll 
)
static

Definition at line 2264 of file ncbi_connutil.c.

Referenced by ConnNetInfo_Log().

◆ s_SaveUserHeader()

static void s_SaveUserHeader ( char *  s,
const char *  name,
const char *  uh,
size_t  uhlen 
)
static

Definition at line 2269 of file ncbi_connutil.c.

References UTIL_PrintableString.

Referenced by ConnNetInfo_Log().

◆ s_SOCK_IO()

static EIO_Status s_SOCK_IO ( void *  stream,
void *  buf,
size_t  size,
size_t *  n_read,
EIO_Event  what 
)
static

◆ s_StripToPattern()

static EIO_Status s_StripToPattern ( void *  stream,
FDoIO  io_func,
const void *  pattern,
size_t  pattern_size,
BUF discard,
size_t *  n_discarded 
)
static

◆ SERV_AddFirewallPort()

int SERV_AddFirewallPort ( unsigned short  port)

Definition at line 3426 of file ncbi_connutil.c.

References n, s_FWPorts, and SizeOf.

Referenced by CConnTest::CheckFWConnections(), and x_ParseFirewall().

◆ SERV_InitFirewallPorts()

void SERV_InitFirewallPorts ( void  )

Definition at line 3420 of file ncbi_connutil.c.

References s_FWPorts.

Referenced by CConnTest::CheckFWConnections().

◆ SERV_IsFirewallPort()

int SERV_IsFirewallPort ( unsigned short  port)

Definition at line 3441 of file ncbi_connutil.c.

References n, s_FWPorts, and SizeOf.

Referenced by s_Open(), and CConnTest::x_GetFirewallConfiguration().

◆ SERV_PrintFirewallPorts()

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

◆ x_AppendArg()

static int x_AppendArg ( SConnNetInfo info,
const char *  arg,
const char *  val 
)
static

Definition at line 1739 of file ncbi_connutil.c.

References assert, info, memmove, s_InfoIsValid(), and val.

Referenced by ConnNetInfo_AppendArg(), and ConnNetInfo_PostOverrideArg().

◆ x_BadMagic()

static const char* x_BadMagic ( unsigned int  magic,
char  buf[] 
)
static

Definition at line 2115 of file ncbi_connutil.c.

References buf, and CONN_NET_INFO_MAGIC.

Referenced by ConnNetInfo_Log().

◆ x_ClientAddress()

static const char* x_ClientAddress ( const char *  client_host,
int  local_host 
)
static

◆ x_CredInfo()

static const char* x_CredInfo ( NCBI_CRED  cred,
char  buf[] 
)
static

Definition at line 2207 of file ncbi_connutil.c.

References buf, eNcbiCred_GnuTls, eNcbiCred_MbedTls, and SNcbiCred::type.

Referenced by ConnNetInfo_Log().

◆ x_DeleteAllArgs()

static void x_DeleteAllArgs ( SConnNetInfo info,
const char *  args 
)
static

◆ x_DeleteArg()

static int x_DeleteArg ( SConnNetInfo info,
const char *  arg 
)
static

Definition at line 1852 of file ncbi_connutil.c.

References assert, info, memmove, s_InfoIsValid(), and strncasecmp.

Referenced by ConnNetInfo_DeleteArg(), and x_DeleteAllArgs().

◆ x_DestroyNetInfo()

static void x_DestroyNetInfo ( SConnNetInfo info,
unsigned int  magic 
)
static

Definition at line 725 of file ncbi_connutil.c.

References assert, CONN_NET_INFO_MAGIC, free(), and info.

Referenced by ConnNetInfo_CreateInternal(), and ConnNetInfo_Destroy().

◆ x_Firewall()

static const char* x_Firewall ( unsigned int  firewall)
static

Definition at line 2190 of file ncbi_connutil.c.

References assert, eFWMode_Adaptive, eFWMode_Fallback, and eFWMode_Firewall.

Referenced by ConnNetInfo_Log().

◆ x_GetReferer()

static const char* x_GetReferer ( char *  str,
size_t  size 
)
static

◆ x_GetValue()

static const char* x_GetValue ( const char *  svc,
size_t  svclen,
const char *  param,
char *  value,
size_t  value_size,
const char *  def_value,
int generic,
FStrNCmp  strncompar 
)
static

◆ x_IsSufficientAddress()

static int x_IsSufficientAddress ( const char *  addr)
static

Definition at line 1948 of file ncbi_connutil.c.

References SOCK_isip().

Referenced by x_ClientAddress().

◆ x_mkenv()

static int x_mkenv ( char *  str,
size_t  len 
)
static

Definition at line 149 of file ncbi_connutil.c.

References assert, isalpha(), isdigit(), isspace(), len, and str().

Referenced by x_GetValue().

◆ x_Num()

static const char* x_Num ( unsigned int  num,
char  buf[] 
)
static

Definition at line 2123 of file ncbi_connutil.c.

References buf.

Referenced by ConnNetInfo_Log(), x_ReqMethod(), and x_Scheme().

◆ x_ParseFirewall()

static EFWMode x_ParseFirewall ( const char *  str,
int  generic 
)
static

◆ x_ParseScheme()

static EURLScheme x_ParseScheme ( const char *  str,
size_t  len 
)
static

Definition at line 457 of file ncbi_connutil.c.

References assert, eURL_File, eURL_Ftp, eURL_Http, eURL_Https, eURL_Unspec, len, str(), and strncasecmp.

Referenced by ConnNetInfo_ParseURL().

◆ x_Port()

static const char* x_Port ( unsigned short  port,
char  buf[] 
)
static

Definition at line 2150 of file ncbi_connutil.c.

References assert, and buf.

Referenced by ConnNetInfo_Log().

◆ x_PrependArg()

static int x_PrependArg ( SConnNetInfo info,
const char *  arg,
const char *  val 
)
static

Definition at line 1798 of file ncbi_connutil.c.

References assert, info, memmove, s_InfoIsValid(), and val.

Referenced by ConnNetInfo_PreOverrideArg(), and ConnNetInfo_PrependArg().

◆ x_ProxyStr()

static const char* x_ProxyStr ( EBProxyType  proxy)
static

Definition at line 509 of file ncbi_connutil.c.

References assert, fProxy_Http, fProxy_Https, and fProxy_None.

Referenced by ConnNetInfo_Log(), and x_SetupHttpProxy().

◆ x_ReqMethod()

static const char* x_ReqMethod ( TReqMethod  req_method,
char  buf[] 
)
static

◆ x_Scheme()

static const char* x_Scheme ( EURLScheme  scheme,
char  buf[] 
)
static

Definition at line 2130 of file ncbi_connutil.c.

References buf, eURL_File, eURL_Ftp, eURL_Http, eURL_Https, eURL_Unspec, and x_Num().

Referenced by ConnNetInfo_Log(), and ConnNetInfo_URL().

◆ x_SepAndLen()

static const char* x_SepAndLen ( const char *  str,
const char *  sep,
size_t *  len 
)
static

Definition at line 1538 of file ncbi_connutil.c.

References len, n, and str().

Referenced by ConnNetInfo_AddPath(), and ConnNetInfo_SetPath().

◆ x_SetArgs()

static int x_SetArgs ( SConnNetInfo info,
const char *  args 
)
static

Definition at line 1642 of file ncbi_connutil.c.

References assert, info, memmove, and s_InfoIsValid().

Referenced by ConnNetInfo_CreateInternal(), and ConnNetInfo_SetArgs().

◆ x_SetupHttpProxy()

static int x_SetupHttpProxy ( SConnNetInfo info,
const char *  env,
EBProxyType  proxy 
)
static

◆ x_SetupSystemHttpProxy()

static int x_SetupSystemHttpProxy ( SConnNetInfo info)
static

◆ x_StrcatCRLF()

static int x_StrcatCRLF ( char **  dstp,
const char *  src,
int  pre 
)
static

◆ x_strncpy0()

static const char* x_strncpy0 ( char *  dst,
const char *  src,
size_t  dst_size 
)
static

Definition at line 134 of file ncbi_connutil.c.

References assert, and strncpy0().

Referenced by x_GetValue().

◆ x_TagValueMatches()

static int x_TagValueMatches ( const char *  oldval,
size_t  oldvallen,
const char *  newval,
size_t  newvallen 
)
static

Definition at line 1041 of file ncbi_connutil.c.

References assert, isspace(), and strncasecmp.

Referenced by s_ModifyUserHeader().

◆ x_Trim()

static void x_Trim ( char *  str)
static

Definition at line 295 of file ncbi_connutil.c.

References assert, isspace(), len, memmove, and str().

Referenced by s_GetValue().

◆ x_URLConnectErrorReturn()

static EIO_Status x_URLConnectErrorReturn ( SOCK  sock,
EIO_Status  status 
)
static

Definition at line 2469 of file ncbi_connutil.c.

References SOCK_Abort(), and SOCK_Close().

Referenced by URL_ConnectEx().

Variable Documentation

◆ kDigits

const char kDigits[] = "0123456789"
static

Definition at line 51 of file ncbi_connutil.c.

Referenced by ConnNetInfo_ParseURL().

◆ kMIME_Encoding

const char* kMIME_Encoding[eENCOD_Unknown+1]
static
Initial value:
= {
"",
"urlencoded",
"encoded"
}

Definition at line 3286 of file ncbi_connutil.c.

Referenced by MIME_ComposeContentTypeEx(), and MIME_ParseContentTypeEx().

◆ kMIME_SubType

const char* kMIME_SubType[eMIME_Unknown+1]
static
Initial value:
= {
"x-dispatch",
"x-asn-text",
"x-asn-binary",
"x-fasta",
"x-www-form",
"html",
"plain",
"xml",
"xml+soap",
"octet-stream",
"x-unknown"
}

Definition at line 3272 of file ncbi_connutil.c.

Referenced by MIME_ComposeContentTypeEx(), and MIME_ParseContentTypeEx().

◆ kMIME_Type

const char* kMIME_Type[eMIME_T_Unknown+1]
static
Initial value:
= {
"x-ncbi-data",
"text",
"application",
"unknown"
}

Definition at line 3265 of file ncbi_connutil.c.

Referenced by MIME_ComposeContentTypeEx(), and MIME_ParseContentTypeEx().

◆ s_EncodeTable

const char s_EncodeTable[256][4]
static

Definition at line 3096 of file ncbi_connutil.c.

Referenced by URL_EncodeEx().

◆ s_FWPorts

TNCBI_BigCount s_FWPorts[1024/sizeof(TNCBI_BigCount)] = { 0 }
static
Modified on Sat Jun 22 10:39:34 2024 by modify_doxy.py rev. 669887