NCBI C++ ToolKit
Classes | Macros | Typedefs | Functions | Variables
ncbi_service_connector.c File Reference
#include "ncbi_ansi_ext.h"
#include "ncbi_comm.h"
#include "ncbi_priv.h"
#include "ncbi_servicep.h"
#include "ncbi_socketp.h"
#include <connect/ncbi_service_connector.h>
#include <connect/ncbi_socket_connector.h>
#include <ctype.h>
#include <stdlib.h>
+ Include dependency graph for ncbi_service_connector.c:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

struct  SServiceConnectorTag
 

Macros

#define NCBI_USE_ERRCODE_X   Connect_Service
 

Typedefs

typedef struct SServiceConnectorTag SServiceConnector
 

Functions

static const char * s_VT_GetType (CONNECTOR connector)
 
static char * s_VT_Descr (CONNECTOR connector)
 
static EIO_Status s_VT_Open (CONNECTOR connector, const STimeout *timeout)
 
static EIO_Status s_VT_Status (CONNECTOR connector, EIO_Event direction)
 
static EIO_Status s_VT_Close (CONNECTOR connector, const STimeout *timeout)
 
static void s_Setup (CONNECTOR connector)
 
static void s_Destroy (CONNECTOR connector)
 
static int s_OpenDispatcher (SServiceConnector *uuu)
 
static void s_CloseDispatcher (SServiceConnector *uuu)
 
static void s_Reset (SMetaConnector *meta, CONNECTOR connector)
 
static EHTTP_HeaderParse s_ParseHeader (const char *header, void *user_data, int server_error, int user_callback_enabled)
 
static EHTTP_HeaderParse s_ParseHeaderUCB (const char *header, void *data, int server_error)
 
static EHTTP_HeaderParse s_ParseHeaderNoUCB (const char *header, void *data, int server_error)
 
static int s_IsContentTypeDefined (const char *service, const SConnNetInfo *net_info, EMIME_Type mime_t, EMIME_SubType mime_s, EMIME_Encoding mime_e)
 
static const char * s_AdjustNetParams (const char *service, const char *svcname, SConnNetInfo *net_info, EReqMethod req_method, const char *cgi_path, const char *cgi_args, const char *args, const char *static_header, EMIME_Type mime_t, EMIME_SubType mime_s, EMIME_Encoding mime_e, const char *extend_header)
 
static SSERV_InfoCPtr s_GetNextInfo (SServiceConnector *uuu, int http)
 
static char * x_HostPort (const char *host, unsigned short aport)
 
static CONNECTOR s_SocketConnectorBuilder (SConnNetInfo *net_info, const char *hostport, EIO_Status *status, const void *data, size_t size, TSOCK_Flags flags)
 
static int x_SetHostPort (SConnNetInfo *net_info, const SSERV_Info *info)
 
static int s_Adjust (SConnNetInfo *net_info, void *data, unsigned int n)
 
static void x_SetDefaultReferer (SConnNetInfo *net_info, SERV_ITER iter)
 
static void x_DestroyConnector (CONNECTOR c)
 
static CONNECTOR s_Open (SServiceConnector *uuu, const STimeout *timeout, SSERV_InfoCPtr info, SConnNetInfo *net_info, EIO_Status *status)
 
static void s_Cleanup (SServiceConnector *uuu)
 
static EIO_Status s_Close (CONNECTOR connector, const STimeout *timeout, int cleanup)
 
CONNECTOR SERVICE_CreateConnectorEx (const char *name, TSERV_Type types, const SConnNetInfo *net_info, const SSERVICE_Extra *extra)
 

Variables

static const char kHttpHostTag [] = "Host: "
 

Macro Definition Documentation

◆ NCBI_USE_ERRCODE_X

#define NCBI_USE_ERRCODE_X   Connect_Service

Definition at line 43 of file ncbi_service_connector.c.

Typedef Documentation

◆ SServiceConnector

Function Documentation

◆ s_Adjust()

static int s_Adjust ( SConnNetInfo net_info,
void *  data,
unsigned int  n 
)
static

◆ s_AdjustNetParams()

static const char* s_AdjustNetParams ( const char *  service,
const char *  svcname,
SConnNetInfo net_info,
EReqMethod  req_method,
const char *  cgi_path,
const char *  cgi_args,
const char *  args,
const char *  static_header,
EMIME_Type  mime_t,
EMIME_SubType  mime_s,
EMIME_Encoding  mime_e,
const char *  extend_header 
)
static

◆ s_Cleanup()

static void s_Cleanup ( SServiceConnector uuu)
static

◆ s_Close()

static EIO_Status s_Close ( CONNECTOR  connector,
const STimeout timeout,
int  cleanup 
)
static

◆ s_CloseDispatcher()

static void s_CloseDispatcher ( SServiceConnector uuu)
static

Definition at line 114 of file ncbi_service_connector.c.

References SServiceConnectorTag::iter, and SERV_Close().

Referenced by s_Close(), and s_Destroy().

◆ s_Destroy()

static void s_Destroy ( CONNECTOR  connector)
static

◆ s_GetNextInfo()

static SSERV_InfoCPtr s_GetNextInfo ( SServiceConnector uuu,
int  http 
)
static

◆ s_IsContentTypeDefined()

static int s_IsContentTypeDefined ( const char *  service,
const SConnNetInfo net_info,
EMIME_Type  mime_t,
EMIME_SubType  mime_s,
EMIME_Encoding  mime_e 
)
static

◆ s_Open()

static CONNECTOR s_Open ( SServiceConnector uuu,
const STimeout timeout,
SSERV_InfoCPtr  info,
SConnNetInfo net_info,
EIO_Status status 
)
static

Definition at line 763 of file ncbi_service_connector.c.

References SSERVICE_Extra::adjust, assert, conn, CONN_Close(), CONN_Create(), CONN_Flush(), CONN_SetTimeout(), ConnNetInfo_DeleteUserHeader(), ConnNetInfo_ExtendUserHeader(), ConnNetInfo_OverrideUserHeader(), ConnNetInfo_SetArgs(), CORE_LOGF_X, SSERVICE_Extra::data, SServiceConnectorTag::descr, eENCOD_None, eFWMode_Fallback, eIO_Close, eIO_Open, eIO_ReadWrite, eIO_Success, eLOG_Error, eLOG_Warning, eMIME_T_Undefined, eMIME_Undefined, eReqMethod_Any, eReqMethod_Get, eReqMethod_Post, eURL_Http, eURL_Https, eURL_Unspec, SServiceConnectorTag::extra, fHTTP_AdjustOnRedirect, fHTTP_AutoReconnect, fHTTP_Flushable, fHTTP_NoAutoRetry, SConnNetInfo::firewall, SSERVICE_Extra::flags, free(), fSERV_Firewall, fSERV_Http, fSERV_HttpGet, fSERV_HttpPost, fSERV_Ncbid, fSERV_Secure, fSERV_Standalone, fSOCK_Secure, SConnNetInfo::host, SServiceConnectorTag::host, HTTP_CreateConnectorEx(), SConnNetInfo::http_referer, info, IO_StatusStr(), SServiceConnectorTag::iter, kHttpHostTag, SServiceConnectorTag::name, SSERV_IterTag::name, NCBI_CXX_TOOLKIT, NCBI_DISP_VERSION, NCBID_WEBPATH, SConnNetInfo::port, SServiceConnectorTag::port, SConnNetInfo::req_method, s_Adjust(), s_AdjustNetParams(), s_ParseHeaderNoUCB(), s_ParseHeaderUCB(), s_SocketConnectorBuilder(), SConnNetInfo::scheme, SServiceConnectorTag::secure, SERV_HTTP_ARGS, SERV_HTTP_PATH, SERV_IsFirewallPort(), SERV_NCBID_ARGS, SERV_Print(), SOCK_ntoa(), SConnNetInfo::stateless, SServiceConnectorTag::ticket, type, SServiceConnectorTag::user_header, x_DestroyConnector(), x_HostPort(), x_SetDefaultReferer(), and x_SetHostPort().

Referenced by s_VT_Open().

◆ s_OpenDispatcher()

static int s_OpenDispatcher ( SServiceConnector uuu)
static

◆ s_ParseHeader()

static EHTTP_HeaderParse s_ParseHeader ( const char *  header,
void *  user_data,
int  server_error,
int  user_callback_enabled 
)
static

◆ s_ParseHeaderNoUCB()

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

Definition at line 234 of file ncbi_service_connector.c.

References data, and s_ParseHeader().

Referenced by s_Open().

◆ s_ParseHeaderUCB()

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

Definition at line 221 of file ncbi_service_connector.c.

References data, and s_ParseHeader().

Referenced by s_Open().

◆ s_Reset()

static void s_Reset ( SMetaConnector meta,
CONNECTOR  connector 
)
static

Definition at line 124 of file ncbi_service_connector.c.

References CONN_SET_METHOD, s_VT_Descr(), and s_VT_Status().

Referenced by s_Close(), and s_Setup().

◆ s_Setup()

static void s_Setup ( CONNECTOR  connector)
static

◆ s_SocketConnectorBuilder()

static CONNECTOR s_SocketConnectorBuilder ( SConnNetInfo net_info,
const char *  hostport,
EIO_Status status,
const void *  data,
size_t  size,
TSOCK_Flags  flags 
)
static

◆ s_VT_Close()

static EIO_Status s_VT_Close ( CONNECTOR  connector,
const STimeout timeout 
)
static

Definition at line 1238 of file ncbi_service_connector.c.

References s_Close().

Referenced by s_Setup().

◆ s_VT_Descr()

static char * s_VT_Descr ( CONNECTOR  connector)
static

Definition at line 1083 of file ncbi_service_connector.c.

References SServiceConnectorTag::descr, SConnectorTag::handle, and strdup.

Referenced by s_Reset().

◆ s_VT_GetType()

static const char * s_VT_GetType ( CONNECTOR  connector)
static

◆ s_VT_Open()

static EIO_Status s_VT_Open ( CONNECTOR  connector,
const STimeout timeout 
)
static

Definition at line 1090 of file ncbi_service_connector.c.

References assert, SMetaConnector::c_descr, SMetaConnector::c_flush, SMetaConnector::c_get_type, SMetaConnector::c_open, SMetaConnector::c_read, SMetaConnector::c_status, SMetaConnector::c_wait, SMetaConnector::c_write, CONN_FWD_LINK, CONN_SET_METHOD, ConnNetInfo_Clone(), ConnNetInfo_Destroy(), ConnNetInfo_URL(), CORE_LOGF_X, SMetaConnector::descr, SServiceConnectorTag::descr, eIO_NotSupported, eIO_Success, eIO_Unknown, eLOG_Error, SConnNetInfo::firewall, SMetaConnector::flush, for(), fProxy_Http, free(), fSERV_Firewall, g_kNcbiSockNameAbbr, SMetaConnector::get_type, SConnectorTag::handle, SConnNetInfo::http_proxy_host, SConnNetInfo::http_proxy_leak, SConnNetInfo::http_proxy_mask, SConnNetInfo::http_proxy_pass, SConnNetInfo::http_proxy_port, SConnNetInfo::http_proxy_skip, SConnNetInfo::http_proxy_user, info, IO_StatusStr(), SServiceConnectorTag::iter, SMetaConnector::list, malloc(), SConnNetInfo::max_try, SConnectorTag::meta, SServiceConnectorTag::meta, METACONN_Insert(), SServiceConnectorTag::name, SServiceConnectorTag::net_info, SConnectorTag::next, SMetaConnector::open, SMetaConnector::read, SServiceConnectorTag::retry, s_Close(), s_GetNextInfo(), s_Open(), s_OpenDispatcher(), SERV_MapperName(), SConnNetInfo::stateless, SMetaConnector::status, SServiceConnectorTag::status, util::strcmp(), SServiceConnectorTag::type, type, SMetaConnector::wait, SServiceConnectorTag::warned, SMetaConnector::write, and x_DestroyConnector().

Referenced by s_Setup().

◆ s_VT_Status()

static EIO_Status s_VT_Status ( CONNECTOR  connector,
EIO_Event  direction 
)
static

Definition at line 1232 of file ncbi_service_connector.c.

References SConnectorTag::handle.

Referenced by s_Reset().

◆ x_DestroyConnector()

static void x_DestroyConnector ( CONNECTOR  c)
static

Definition at line 755 of file ncbi_service_connector.c.

References assert, SConnectorTag::destroy, SConnectorTag::meta, and SConnectorTag::next.

Referenced by s_Open(), and s_VT_Open().

◆ x_HostPort()

static char* x_HostPort ( const char *  host,
unsigned short  aport 
)
static

Definition at line 412 of file ncbi_service_connector.c.

References malloc().

Referenced by s_Open().

◆ x_SetDefaultReferer()

static void x_SetDefaultReferer ( SConnNetInfo net_info,
SERV_ITER  iter 
)
static

◆ x_SetHostPort()

static int x_SetHostPort ( SConnNetInfo net_info,
const SSERV_Info info 
)
static

Variable Documentation

◆ kHttpHostTag

const char kHttpHostTag[] = "Host: "
static

Definition at line 76 of file ncbi_service_connector.c.

Referenced by s_Adjust(), s_Open(), and x_SetHostPort().

Modified on Wed Jun 19 17:03:16 2024 by modify_doxy.py rev. 669887