YAZ  5.23.1
Functions | Variables
seshigh.c File Reference

Implements GFS session logic. More...

#include <limits.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <yaz/facet.h>
#include <yaz/xmalloc.h>
#include <yaz/comstack.h>
#include "eventl.h"
#include "session.h"
#include "mime.h"
#include <yaz/proto.h>
#include <yaz/oid_db.h>
#include <yaz/log.h>
#include <yaz/logrpn.h>
#include <yaz/querytowrbuf.h>
#include <yaz/statserv.h>
#include <yaz/diagbib1.h>
#include <yaz/charneg.h>
#include <yaz/otherinfo.h>
#include <yaz/yaz-util.h>
#include <yaz/pquery.h>
#include <yaz/query-charset.h>
#include <yaz/srw.h>
#include <yaz/backend.h>
#include <yaz/yaz-ccl.h>

Go to the source code of this file.

Functions

static void process_gdu_request (association *assoc, request *req)
 
static int process_z_request (association *assoc, request *req, char **msg)
 
static int process_gdu_response (association *assoc, request *req, Z_GDU *res)
 
static int process_z_response (association *assoc, request *req, Z_APDU *res)
 
static Z_APDUprocess_initRequest (association *assoc, request *reqb)
 
static Z_Externalinit_diagnostics (ODR odr, int errcode, const char *errstring)
 
static Z_APDUprocess_searchRequest (association *assoc, request *reqb)
 
static Z_APDUresponse_searchRequest (association *assoc, request *reqb, bend_search_rr *bsrr)
 
static Z_APDUprocess_presentRequest (association *assoc, request *reqb)
 
static Z_APDUprocess_scanRequest (association *assoc, request *reqb)
 
static Z_APDUprocess_sortRequest (association *assoc, request *reqb)
 
static void process_close (association *assoc, request *reqb)
 
static Z_APDUprocess_deleteRequest (association *assoc, request *reqb)
 
static Z_APDUprocess_segmentRequest (association *assoc, request *reqb)
 
static Z_APDUprocess_ESRequest (association *assoc, request *reqb)
 
static void get_logbits (void)
 
static void wr_diag (WRBUF w, int error, const char *addinfo)
 
static int odr_int_to_int (Odr_int v)
 
associationcreate_association (IOCHAN channel, COMSTACK link, const char *apdufile)
 
void destroy_association (association *h)
 
static void do_close_req (association *a, int reason, char *message, request *req)
 
static void do_close (association *a, int reason, char *message)
 
int ir_read (IOCHAN h, int event)
 
void ir_session (IOCHAN h, int event)
 
static void assoc_init_reset (association *assoc, const char *peer_name1)
 
static int srw_bend_init (association *assoc, Z_HTTP_Header *headers, Z_SRW_diagnostic **d, int *num, Z_SRW_PDU *sr)
 
static int retrieve_fetch (association *assoc, bend_fetch_rr *rr)
 
static int srw_bend_fetch (association *assoc, int pos, Z_SRW_searchRetrieveRequest *srw_req, Z_SRW_record *record, const char **addinfo, int *last_in_set)
 
static int cql2pqf (ODR odr, const char *cql, cql_transform_t ct, Z_Query *query_result, char **sortkeys_p)
 
static int cql2pqf_scan (ODR odr, const char *cql, cql_transform_t ct, Z_AttributesPlusTerm *result)
 
static int ccl2pqf (ODR odr, const Odr_oct *ccl, CCL_bibset bibset, bend_search_rr *bsrr)
 
static void srw_bend_search (association *assoc, Z_HTTP_Header *headers, Z_SRW_PDU *sr, Z_SRW_PDU *res, int *http_code)
 
static char * srw_bend_explain_default (bend_explain_rr *rr)
 
static void srw_bend_explain (association *assoc, Z_HTTP_Header *headers, Z_SRW_PDU *sr, Z_SRW_explainResponse *srw_res, int *http_code)
 
static void srw_bend_scan (association *assoc, Z_HTTP_Header *headers, Z_SRW_PDU *sr, Z_SRW_PDU *res, int *http_code)
 
static void srw_bend_update (association *assoc, Z_HTTP_Header *headers, Z_SRW_PDU *sr, Z_SRW_updateResponse *srw_res, int *http_code)
 
static int check_path (const char *path)
 
static char * read_file (const char *fname, ODR o, size_t *sz)
 
static void process_http_request (association *assoc, request *req)
 
static char * get_vhost (Z_OtherInformation *otherInfo)
 
static Z_Recordsdiagrec (association *assoc, int error, char *addinfo)
 
static Z_NamePlusRecordsurrogatediagrec (association *assoc, const char *dbname, int error, const char *addinfo)
 
static Z_Recordspack_records (association *a, char *setname, Odr_int start, Odr_int *num, Z_RecordComposition *comp, Odr_int *next, Odr_int *pres, Z_ReferenceId *referenceId, Odr_oid *oid, int *errcode)
 
int bend_assoc_is_alive (bend_association assoc)
 

Variables

static int logbits_set = 0
 
static int log_session = 0
 
static int log_sessiondetail = 0
 
static int log_request = 0
 
static int log_requestdetail = 0
 

Detailed Description

Implements GFS session logic.

Frontend server logic.

This code receives incoming APDUs, and handles client requests by means of the backend API.

Some of the code is getting quite involved, compared to simpler servers - primarily because it is asynchronous both in the communication with the user and the backend. We think the complexity will pay off in the form of greater flexibility when more asynchronous facilities are implemented.

Memory management has become somewhat involved. In the simple case, where only one PDU is pending at a time, it will simply reuse the same memory, once it has found its working size. When we enable multiple concurrent operations, perhaps even with multiple parallel calls to the backend, it will maintain a pool of buffers for encoding and decoding, trying to minimize memory allocation/deallocation during normal operation.

Definition in file seshigh.c.

Function Documentation

static void assoc_init_reset ( association assoc,
const char *  peer_name1 
)
static
int bend_assoc_is_alive ( bend_association  assoc)

Definition at line 3514 of file seshigh.c.

References ASSOC_DEAD, association::client_chan, iochan_is_alive(), and association::state.

Referenced by check_slow().

static int ccl2pqf ( ODR  odr,
const Odr_oct ccl,
CCL_bibset  bibset,
bend_search_rr bsrr 
)
static
static int check_path ( const char *  path)
static

Definition at line 1741 of file seshigh.c.

Referenced by process_http_request().

static int cql2pqf ( ODR  odr,
const char *  cql,
cql_transform_t  ct,
Z_Query query_result,
char **  sortkeys_p 
)
static
static int cql2pqf_scan ( ODR  odr,
const char *  cql,
cql_transform_t  ct,
Z_AttributesPlusTerm result 
)
static
association* create_association ( IOCHAN  channel,
COMSTACK  link,
const char *  apdufile 
)
void destroy_association ( association h)
static Z_Records* diagrec ( association assoc,
int  error,
char *  addinfo 
)
static
static void do_close ( association a,
int  reason,
char *  message 
)
static

Definition at line 259 of file seshigh.c.

References do_close_req(), association::outgoing, and request_get().

Referenced by ir_read(), and ir_session().

static void do_close_req ( association a,
int  reason,
char *  message,
request req 
)
static
static void get_logbits ( void  )
static

get_logbits sets global loglevel bits

Definition at line 108 of file seshigh.c.

References log_request, log_requestdetail, log_session, log_sessiondetail, logbits_set, and yaz_log_module_level().

Referenced by create_association().

static char* get_vhost ( Z_OtherInformation otherInfo)
static

Definition at line 2175 of file seshigh.c.

References yaz_oi_get_string_oid(), and yaz_oid_userinfo_proxy.

Referenced by process_initRequest().

static Z_External * init_diagnostics ( ODR  odr,
int  errcode,
const char *  errstring 
)
static

Definition at line 2461 of file seshigh.c.

References diagbib1_str(), log_requestdetail, yaz_log(), and zget_init_diagnostics().

Referenced by process_initRequest().

int ir_read ( IOCHAN  h,
int  event 
)
void ir_session ( IOCHAN  h,
int  event 
)
static int odr_int_to_int ( Odr_int  v)
static
static Z_Records* pack_records ( association a,
char *  setname,
Odr_int  start,
Odr_int num,
Z_RecordComposition comp,
Odr_int next,
Odr_int pres,
Z_ReferenceId referenceId,
Odr_oid oid,
int *  errcode 
)
static
static void process_close ( association assoc,
request reqb 
)
static
static Z_APDU * process_deleteRequest ( association assoc,
request reqb 
)
static
static Z_APDU * process_ESRequest ( association assoc,
request reqb 
)
static
static void process_gdu_request ( association assoc,
request req 
)
static
static int process_gdu_response ( association assoc,
request req,
Z_GDU res 
)
static
static void process_http_request ( association assoc,
request req 
)
static

Definition at line 1767 of file seshigh.c.

References ASSOC_DEAD, check_path(), association::client_chan, Z_HTTP_Response::code, Z_HTTP_Response::content_buf, Z_HTTP_Response::content_len, control_association(), association::cs_get_mask, association::decode, Z_SRW_searchRetrieveResponse::diagnostics, Z_SRW_explainResponse::diagnostics, Z_SRW_scanResponse::diagnostics, Z_SRW_updateResponse::diagnostics, gfs_server::docpath, association::encode, Z_SRW_PDU::explain_request, Z_SRW_PDU::explain_response, request::gdu_request, Z_SOAP::generic, Z_HTTP_Request::headers, Z_HTTP_Response::headers, Z_GDU::HTTP_Request, Z_GDU::HTTP_Response, iochan_settimeout, statserv_options_block::keepalive, association::last_control, log_request, Z_HTTP_Request::method, Z_SRW_searchRetrieveResponse::num_diagnostics, Z_SRW_explainResponse::num_diagnostics, Z_SRW_scanResponse::num_diagnostics, Z_SRW_updateResponse::num_diagnostics, Z_SOAP_Generic::p, Z_HTTP_Request::path, process_gdu_response(), read_file(), Z_SRW_PDU::request, Z_SRW_PDU::response, Z_SRW_PDU::scan_request, Z_SRW_PDU::scan_response, association::server, srw_bend_explain(), srw_bend_scan(), srw_bend_search(), srw_bend_update(), Z_SRW_PDU::srw_version, association::state, gfs_server::stylesheet, Z_SRW_searchRetrieveRequest::stylesheet, Z_SRW_explainRequest::stylesheet, Z_SRW_scanRequest::stylesheet, Z_SOAP::u, Z_GDU::u, Z_SRW_PDU::u, Z_SRW_PDU::update_response, Z_HTTP_Request::version, Z_HTTP_Response::version, Z_SRW_PDU::which, yaz_isdigit, yaz_log(), yaz_mime_lookup_fname(), yaz_mime_types_add(), yaz_mime_types_create(), yaz_mime_types_destroy(), yaz_sru_decode(), yaz_srw_codec(), yaz_srw_decode(), yaz_srw_get_pdu(), yaz_srw_get_pdu_e(), yaz_ucp_codec(), YAZ_XMLNS_SRU_v1_0, YAZ_XMLNS_SRU_v1_1, YAZ_XMLNS_UPDATE_v0_9, YLOG_DEBUG, YLOG_LOG, z_get_HTTP_Response(), z_HTTP_header_add(), z_HTTP_header_lookup(), z_soap_codec_enc_xsl(), z_soap_error(), Z_SRW_explain_request, Z_SRW_explain_response, Z_SRW_scan_request, Z_SRW_scan_response, Z_SRW_searchRetrieve_request, Z_SRW_searchRetrieve_response, Z_SRW_update_request, and Z_SRW_update_response.

Referenced by process_gdu_request().

static Z_APDU * process_initRequest ( association assoc,
request reqb 
)
static

Definition at line 2187 of file seshigh.c.

References request::apdu_request, ASSOC_DEAD, assoc_init_reset(), ASSOC_UP, bend_initrequest::auth, association::backend, statserv_options_block::bend_close, bend_initrequest::bend_delete, bend_initrequest::bend_esrequest, statserv_options_block::bend_init, bend_initrequest::bend_present, bend_initrequest::bend_scan, bend_initrequest::bend_search, bend_initrequest::bend_segment, bend_initrequest::bend_sort, bend_initrequest::charneg_request, bend_initrequest::charneg_response, association::client_chan, statserv_options_block::configname, control_association(), association::encode, bend_initresult::errcode, bend_initresult::errstring, Z_OtherInformationUnit::externallyDefinedInfo, get_vhost(), Z_IdPass::groupId, bend_initresult::handle, Z_InitRequest::idAuthentication, statserv_options_block::idle_timeout, Z_IdAuthentication::idPass, bend_initrequest::implementation_id, bend_initrequest::implementation_name, bend_initrequest::implementation_version, Z_InitRequest::implementationId, Z_InitResponse::implementationId, Z_InitRequest::implementationName, Z_InitResponse::implementationName, Z_InitRequest::implementationVersion, Z_InitResponse::implementationVersion, Z_OtherInformationUnit::information, association::init, init_diagnostics(), Z_APDU::initRequest, Z_APDU::initResponse, iochan_settimeout, log_request, log_requestdetail, association::maximumRecordSize, Z_InitRequest::maximumRecordSize, Z_InitResponse::maximumRecordSize, bend_initrequest::named_result_sets, odr_int_to_int(), odr_intdup(), odr_malloc(), ODR_MASK_GET, ODR_MASK_SET, odr_prepend(), Z_IdAuthentication::open, options(), Z_InitRequest::options, Z_InitResponse::options, Z_InitRequest::otherInfo, Z_InitResponse::otherInfo, association::preferredMessageSize, Z_InitRequest::preferredMessageSize, Z_InitResponse::preferredMessageSize, Z_InitRequest::protocolVersion, Z_InitResponse::protocolVersion, bend_initrequest::query_charset, bend_initrequest::records_in_same_charset, bend_initrequest::referenceId, Z_InitRequest::referenceId, Z_InitResponse::referenceId, Z_InitResponse::result, association::state, statserv_getcontrol(), Z_APDU::u, Z_IdAuthentication::u, Z_IdPass::userId, Z_InitResponse::userInformationField, association::version, Z_CharSetandLanguageNegotiation::which, Z_IdAuthentication::which, Z_OtherInformationUnit::which, wrbuf_alloc(), wrbuf_cstr(), wrbuf_destroy(), wrbuf_printf(), YAZ_BIB1_PERMANENT_SYSTEM_ERROR, yaz_get_charneg_record(), yaz_log(), yaz_oi_get_string_oid(), yaz_oi_update(), yaz_oid_userinfo_client_ip, yaz_set_response_charneg(), YLOG_DEBUG, YLOG_WARN, Z_APDU_initResponse, Z_CharSetandLanguageNegotiation_proposal, Z_IdAuthentication_anonymous, Z_IdAuthentication_idPass, Z_IdAuthentication_open, Z_Options_concurrentOperations, Z_Options_delSet, Z_Options_extendedServices, Z_Options_namedResultSets, Z_Options_negotiationModel, Z_Options_present, Z_Options_scan, Z_Options_search, Z_Options_sort, Z_Options_triggerResourceCtrl, Z_OtherInfo_externallyDefinedInfo, Z_ProtocolVersion_1, Z_ProtocolVersion_2, Z_ProtocolVersion_3, and zget_APDU().

Referenced by process_z_request().

static Z_APDU * process_presentRequest ( association assoc,
request reqb 
)
static
static Z_APDU * process_scanRequest ( association assoc,
request reqb 
)
static

Definition at line 3023 of file seshigh.c.

References Z_TermInfo::alternativeTerm, request::apdu_request, bend_scan_rr::attributeset, Z_ScanRequest::attributeSet, Z_ScanResponse::attributeSet, association::backend, bend_scan_rr::basenames, bend_initrequest::bend_scan, BEND_SCAN_PARTIAL, Z_TermInfo::byAttributes, Z_ScanRequest::databaseNames, association::decode, Z_DiagRecs::diagRecs, scan_entry::display_term, Z_TermInfo::displayTerm, association::encode, bend_scan_rr::entries, Z_ScanResponse::entries, Z_ListEntries::entries, scan_entry::errcode, bend_scan_rr::errcode, scan_entry::errstring, bend_scan_rr::errstring, bend_scan_rr::extra_args, bend_scan_rr::extra_response_data, Z_Term::general, Z_TermInfo::globalOccurrences, association::init, log_request, log_requestdetail, log_scan_term_level(), Z_ListEntries::nonsurrogateDiagnostics, bend_scan_rr::num_bases, Z_ScanRequest::num_databaseNames, Z_DiagRecs::num_diagRecs, bend_scan_rr::num_entries, Z_ListEntries::num_entries, Z_ListEntries::num_nonsurrogateDiagnostics, Z_ScanResponse::numberOfEntriesReturned, Z_ScanRequest::numberOfTermsRequested, scan_entry::occurrences, odr_create_Odr_oct(), ODR_INT_PRINTF, odr_int_to_int(), odr_intdup(), odr_malloc(), odr_strdup(), Z_ScanRequest::otherInfo, Z_ScanResponse::otherInfo, Z_TermInfo::otherTermInfo, Z_ScanResponse::positionOfTerm, Z_ScanRequest::preferredPositionInResponse, association::print, bend_scan_rr::print, bend_scan_rr::referenceId, Z_ScanRequest::referenceId, Z_ScanResponse::referenceId, bend_scan_rr::scanClause, Z_APDU::scanRequest, Z_APDU::scanResponse, Z_ScanResponse::scanStatus, bend_scan_rr::setname, bend_scan_rr::status, bend_scan_rr::step_size, Z_ScanRequest::stepSize, Z_ScanResponse::stepSize, bend_scan_rr::stream, Z_TermInfo::suggestedAttributes, Z_Entry::surrogateDiagnostic, scan_entry::term, bend_scan_rr::term, Z_TermInfo::term, bend_scan_rr::term_position, Z_Entry::termInfo, Z_ScanRequest::termListAndStartPoint, Z_APDU::u, Z_Term::u, Z_Entry::u, Z_APDU::which, Z_Term::which, Z_Entry::which, wr_diag(), wrbuf_alloc(), wrbuf_cstr(), wrbuf_destroy(), wrbuf_printf(), wrbuf_puts(), yaz_log(), yaz_oi_get_string_oid(), yaz_oid_userinfo_scan_set, yaz_scan_to_wrbuf(), YLOG_DEBUG, Z_APDU_scanResponse, Z_Entry_surrogateDiagnostic, Z_Entry_termInfo, Z_Scan_failure, Z_Scan_partial_5, Z_Scan_success, Z_Term_general, and zget_DiagRecs().

Referenced by process_z_request().

static Z_APDU * process_searchRequest ( association assoc,
request reqb 
)
static

Definition at line 2665 of file seshigh.c.

References Z_SearchRequest::additionalSearchInfo, request::apdu_request, bend_search_rr::association, association::backend, bend_search_rr::basenames, bend_initrequest::bend_search, ccl2pqf(), gfs_server::ccl_transform, gfs_server::client_query_charset, Z_External::cql, cql2pqf(), gfs_server::cql_transform, Z_SearchRequest::databaseNames, bend_search_rr::decode, association::decode, association::encode, bend_search_rr::errcode, bend_search_rr::errstring, bend_search_rr::estimated_hit_count, bend_search_rr::extra_args, bend_search_rr::extra_response_data, bend_search_rr::hits, association::init, log_requestdetail, Z_SearchRequest::mediumSetPresentNumber, nmem_malloc(), nmem_transfer(), bend_search_rr::num_bases, Z_SearchRequest::num_databaseNames, odr_getmem, Z_SearchRequest::otherInfo, bend_search_rr::partial_resultset, bend_search_rr::present_number, bend_search_rr::print, association::print, bend_search_rr::query, Z_SearchRequest::query, bend_search_rr::referenceId, Z_SearchRequest::referenceId, bend_search_rr::replace_set, Z_SearchRequest::replaceIndicator, request::request_mem, response_searchRequest(), Z_SearchRequest::resultSetName, bend_search_rr::search_info, bend_search_rr::search_input, Z_APDU::searchRequest, association::server, bend_search_rr::setname, bend_search_rr::srw_setname, bend_search_rr::srw_setnameIdleTime, bend_search_rr::srw_sortKeys, bend_search_rr::stream, Z_Query::type_1, Z_Query::type_104, Z_Query::type_2, Z_External::u, Z_APDU::u, Z_Query::u, Z_External::which, Z_Query::which, yaz_diag_srw_to_bib1(), yaz_iconv_close(), yaz_iconv_open(), yaz_log(), yaz_log_zquery_level(), yaz_query_charset_convert_rpnquery(), YLOG_WARN, Z_External_CQL, Z_Query_type_1, Z_Query_type_104, and Z_Query_type_2.

Referenced by process_z_request().

static Z_APDU * process_segmentRequest ( association assoc,
request reqb 
)
static
static Z_APDU * process_sortRequest ( association assoc,
request reqb 
)
static
static int process_z_request ( association assoc,
request req,
char **  msg 
)
static
static int process_z_response ( association assoc,
request req,
Z_APDU res 
)
static
static char* read_file ( const char *  fname,
ODR  o,
size_t *  sz 
)
static

Definition at line 1750 of file seshigh.c.

References odr_malloc(), yaz_log(), YLOG_ERRNO, and YLOG_WARN.

Referenced by process_http_request().

static Z_APDU * response_searchRequest ( association assoc,
request reqb,
bend_search_rr bsrr 
)
static

Definition at line 2767 of file seshigh.c.

References Z_SearchResponse::additionalSearchInfo, request::apdu_request, bend_present_rr::association, association::backend, bend_initrequest::bend_present, bool_t, bend_present_rr::comp, Z_SearchRequest::databaseNames, diagrec(), association::encode, bend_search_rr::errcode, bend_present_rr::errcode, bend_search_rr::errstring, bend_present_rr::errstring, bend_search_rr::estimated_hit_count, bend_present_rr::format, bend_search_rr::hits, association::init, Z_SearchRequest::largeSetLowerBound, log_request, log_requestdetail, Z_SearchRequest::mediumSetElementSetNames, Z_SearchRequest::mediumSetPresentNumber, Z_SearchResponse::nextResultSetPosition, nmem_malloc(), Z_SearchRequest::num_databaseNames, bend_present_rr::number, Z_SearchResponse::numberOfRecordsReturned, odr_booldup(), ODR_INT_PRINTF, odr_int_to_int(), odr_intdup(), odr_malloc(), Z_SearchResponse::otherInfo, pack_records(), bend_search_rr::partial_resultset, Z_SearchRequest::preferredRecordSyntax, Z_SearchResponse::presentStatus, bend_present_rr::print, association::print, Z_SearchRequest::query, Z_SearchResponse::records, bend_present_rr::referenceId, Z_SearchRequest::referenceId, Z_SearchResponse::referenceId, request::request_mem, Z_SearchResponse::resultCount, Z_SearchRequest::resultSetName, Z_SearchResponse::resultSetStatus, bend_search_rr::search_info, Z_APDU::searchRequest, Z_APDU::searchResponse, Z_SearchResponse::searchStatus, bend_present_rr::setname, Z_RecordComposition::simple, Z_SearchRequest::smallSetElementSetNames, Z_SearchRequest::smallSetUpperBound, bend_present_rr::start, bend_present_rr::stream, Z_APDU::u, Z_RecordComposition::u, Z_APDU::which, Z_RecordComposition::which, wrbuf_alloc(), wrbuf_cstr(), wrbuf_destroy(), wrbuf_printf(), wrbuf_puts(), yaz_log(), yaz_query_to_wrbuf(), YLOG_FATAL, Z_APDU_searchResponse, Z_PresentStatus_failure, Z_RecordComp_simple, Z_SearchResponse_estimate, Z_SearchResponse_none, and Z_SearchResponse_subset.

Referenced by process_searchRequest().

static int retrieve_fetch ( association assoc,
bend_fetch_rr rr 
)
static
static void srw_bend_explain ( association assoc,
Z_HTTP_Header headers,
Z_SRW_PDU sr,
Z_SRW_explainResponse srw_res,
int *  http_code 
)
static
static char* srw_bend_explain_default ( bend_explain_rr rr)
static
static int srw_bend_fetch ( association assoc,
int  pos,
Z_SRW_searchRetrieveRequest srw_req,
Z_SRW_record record,
const char **  addinfo,
int *  last_in_set 
)
static
static int srw_bend_init ( association assoc,
Z_HTTP_Header headers,
Z_SRW_diagnostic **  d,
int *  num,
Z_SRW_PDU sr 
)
static
static void srw_bend_scan ( association assoc,
Z_HTTP_Header headers,
Z_SRW_PDU sr,
Z_SRW_PDU res,
int *  http_code 
)
static

Definition at line 1324 of file seshigh.c.

References bend_scan_rr::attributeset, association::backend, bend_scan_rr::basenames, bend_initrequest::bend_scan, bend_initrequest::bend_srw_scan, cql2pqf_scan(), gfs_server::cql_transform, Z_SRW_scanRequest::database, association::decode, Z_SRW_scanResponse::diagnostics, scan_entry::display_term, Z_SRW_scanTerm::displayTerm, association::encode, bend_scan_rr::entries, scan_entry::errcode, bend_scan_rr::errcode, scan_entry::errstring, bend_scan_rr::errstring, bend_scan_rr::extra_args, Z_SRW_PDU::extra_args, bend_scan_rr::extra_response_data, Z_SRW_PDU::extraResponseData_buf, Z_SRW_PDU::extraResponseData_len, association::init, log_request, log_requestdetail, Z_SRW_scanRequest::maximumTerms, bend_scan_rr::num_bases, Z_SRW_scanResponse::num_diagnostics, bend_scan_rr::num_entries, Z_SRW_scanResponse::num_terms, Z_SRW_scanTerm::numberOfRecords, scan_entry::occurrences, ODR_INT_PRINTF, odr_int_to_int(), odr_intdup(), odr_malloc(), odr_strdup(), association::print, bend_scan_rr::print, Z_SRW_scanRequest::queryType, bend_scan_rr::referenceId, Z_SRW_scanRequest::responsePosition, Z_SRW_PDU::scan_request, Z_SRW_PDU::scan_response, Z_SRW_scanRequest::scanClause, bend_scan_rr::scanClause, association::server, bend_scan_rr::setname, srw_bend_init(), bend_scan_rr::step_size, bend_scan_rr::stream, scan_entry::term, bend_scan_rr::term, bend_scan_rr::term_position, Z_SRW_scanResponse::terms, Z_SRW_PDU::u, Z_SRW_diagnostic::uri, Z_SRW_scanTerm::value, Z_SRW_scanTerm::whereInList, wrbuf_alloc(), wrbuf_cstr(), wrbuf_destroy(), wrbuf_printf(), yaz_add_srw_diagnostic(), YAZ_BIB1_DATABASE_UNAVAILABLE, yaz_diag_bib1_to_srw(), yaz_log(), yaz_pqf_create(), yaz_pqf_destroy(), yaz_pqf_scan(), and YAZ_SRW_UNSUPP_OPERATION.

Referenced by process_http_request().

static void srw_bend_search ( association assoc,
Z_HTTP_Header headers,
Z_SRW_PDU sr,
Z_SRW_PDU res,
int *  http_code 
)
static

Definition at line 919 of file seshigh.c.

References bend_search_rr::association, bend_present_rr::association, association::backend, bend_search_rr::basenames, bend_initrequest::bend_present, bend_initrequest::bend_search, bend_present_rr::comp, Z_External::cql, cql2pqf(), gfs_server::cql_transform, Z_SRW_searchRetrieveRequest::database, bend_search_rr::decode, association::decode, Z_External::descriptor, Z_SRW_searchRetrieveResponse::diagnostics, Z_External::direct_reference, association::encode, bend_search_rr::errcode, bend_present_rr::errcode, bend_search_rr::errstring, bend_present_rr::errstring, bend_search_rr::estimated_hit_count, bend_search_rr::extra_args, Z_SRW_PDU::extra_args, Z_SRW_searchRetrieveResponse::extra_records, bend_search_rr::extra_response_data, Z_SRW_PDU::extraResponseData_buf, Z_SRW_PDU::extraResponseData_len, Z_SRW_searchRetrieveRequest::facetList, Z_SRW_searchRetrieveResponse::facetList, Z_ElementSetNames::generic, bend_search_rr::hits, Z_External::indirect_reference, association::init, log_request, log_requestdetail, Z_SRW_searchRetrieveRequest::maximumRecords, bend_search_rr::num_bases, Z_SRW_searchRetrieveResponse::num_diagnostics, Z_SRW_searchRetrieveResponse::num_records, bend_present_rr::number, Z_SRW_searchRetrieveResponse::numberOfRecords, odr_getoidbystr(), ODR_INT_PRINTF, odr_int_to_int(), odr_intdup(), odr_malloc(), odr_strdup(), bend_search_rr::partial_resultset, bend_search_rr::present_number, bend_search_rr::print, bend_present_rr::print, association::print, bend_search_rr::query, Z_SRW_searchRetrieveRequest::query, Z_SRW_searchRetrieveRequest::queryType, Z_SRW_record::recordData_buf, Z_SRW_record::recordPacking, Z_SRW_searchRetrieveRequest::recordPacking, Z_SRW_searchRetrieveResponse::records, Z_SRW_searchRetrieveRequest::recordSchema, bend_search_rr::referenceId, bend_present_rr::referenceId, bend_search_rr::replace_set, Z_SRW_PDU::request, Z_SRW_PDU::response, Z_SRW_searchRetrieveResponse::resultCountPrecision, Z_SRW_searchRetrieveResponse::resultSetId, Z_SRW_searchRetrieveResponse::resultSetIdleTime, bend_search_rr::search_info, bend_search_rr::search_input, association::server, bend_search_rr::setname, bend_present_rr::setname, Z_RecordComposition::simple, Z_SRW_searchRetrieveRequest::sort, Z_SRW_searchRetrieveRequest::sortKeys, srw_bend_fetch(), srw_bend_init(), bend_search_rr::srw_setname, bend_search_rr::srw_setnameIdleTime, bend_search_rr::srw_sortKeys, Z_SRW_PDU::srw_version, bend_present_rr::start, Z_SRW_searchRetrieveRequest::startRecord, bend_search_rr::stream, bend_present_rr::stream, Z_Query::type_1, Z_Query::type_104, Z_External::u, Z_SRW_PDU::u, Z_Query::u, Z_RecordComposition::u, Z_ElementSetNames::u, Z_SRW_diagnostic::uri, Z_External::which, Z_Query::which, Z_RecordComposition::which, Z_ElementSetNames::which, wrbuf_alloc(), wrbuf_cstr(), wrbuf_destroy(), wrbuf_printf(), yaz_add_srw_diagnostic(), YAZ_BIB1_DATABASE_UNAVAILABLE, yaz_diag_bib1_to_srw(), yaz_log(), yaz_log_zquery_level(), yaz_oi_get_facetlist(), yaz_oi_set_facetlist(), yaz_pqf_create(), yaz_pqf_destroy(), yaz_pqf_error(), yaz_pqf_parse(), YAZ_SRW_FIRST_RECORD_POSITION_OUT_OF_RANGE, YAZ_SRW_QUERY_SYNTAX_ERROR, YAZ_SRW_RESULT_SET_CREATED_WITH_VALID_PARTIAL_RESULTS_AVAILABLE, yaz_srw_str_to_pack(), YAZ_SRW_UNSUPP_QUERY_TYPE, YLOG_DEBUG, Z_ElementSetNames_generic, Z_External_CQL, Z_Query_type_1, Z_Query_type_104, Z_RecordComp_simple, and Z_SRW_recordPacking_string.

Referenced by process_http_request().

static void srw_bend_update ( association assoc,
Z_HTTP_Header headers,
Z_SRW_PDU sr,
Z_SRW_updateResponse srw_res,
int *  http_code 
)
static

Definition at line 1504 of file seshigh.c.

References association::backend, bend_update_rr::basenames, bend_initrequest::bend_srw_update, Z_SRW_updateRequest::database, bend_update_rr::details, Z_SRW_updateResponse::diagnostics, association::encode, Z_SRW_updateRequest::extra_record, Z_SRW_updateResponse::extra_record, bend_update_rr::extra_record_data, bend_update_rr::extra_request_data, bend_update_rr::extra_response_data, Z_SRW_extra_record::extraRecordData_buf, Z_SRW_extra_record::extraRecordData_len, Z_SRW_updateRequest::extraRequestData_buf, Z_SRW_updateRequest::extraRequestData_len, Z_SRW_updateResponse::extraResponseData_buf, Z_SRW_updateResponse::extraResponseData_len, association::init, log_session, bend_update_rr::message, bend_update_rr::num_bases, Z_SRW_updateResponse::num_diagnostics, Z_SRW_updateRequest::num_recordVersions, Z_SRW_updateResponse::num_recordVersions, bend_update_rr::num_versions, odr_strdup(), odr_strdupn(), Z_SRW_updateRequest::operation, bend_update_rr::operation, bend_update_rr::operation_status, Z_SRW_updateResponse::operationStatus, association::print, bend_update_rr::print, Z_SRW_updateRequest::record, Z_SRW_updateResponse::record, bend_update_rr::record_data, bend_update_rr::record_id, bend_update_rr::record_packing, bend_update_rr::record_schema, bend_update_rr::record_versions, Z_SRW_record::recordData_buf, Z_SRW_record::recordData_len, Z_SRW_updateRequest::recordId, Z_SRW_updateResponse::recordId, Z_SRW_extra_record::recordIdentifier, Z_SRW_record::recordPacking, Z_SRW_record::recordSchema, Z_SRW_updateRequest::recordVersions, Z_SRW_updateResponse::recordVersions, srw_bend_init(), bend_update_rr::stream, Z_SRW_PDU::u, Z_SRW_PDU::update_request, bend_update_rr::uri, yaz_add_sru_update_diagnostic(), yaz_add_srw_diagnostic_uri(), yaz_log(), YAZ_SRU_UPDATE_INVALID_ACTION, YAZ_SRU_UPDATE_MISSING_MANDATORY_ELEMENT_RECORD_REJECTED, YAZ_SRU_UPDATE_UNSPECIFIED_DATABASE_ERROR, yaz_srw_get_extra_record(), yaz_srw_get_record(), yaz_srw_pack_to_str(), yaz_srw_str_to_pack(), YLOG_DEBUG, YLOG_WARN, and Z_SRW_recordPacking_string.

Referenced by process_http_request().

static Z_NamePlusRecord* surrogatediagrec ( association assoc,
const char *  dbname,
int  error,
const char *  addinfo 
)
static
static void wr_diag ( WRBUF  w,
int  error,
const char *  addinfo 
)
static

Definition at line 120 of file seshigh.c.

References diagbib1_str(), wrbuf_printf(), wrbuf_puts(), and wrbuf_puts_replace_char().

Referenced by process_scanRequest().

Variable Documentation

int log_request = 0
static
int log_requestdetail = 0
static
int log_session = 0
static

Definition at line 102 of file seshigh.c.

Referenced by get_logbits(), ir_read(), ir_session(), and srw_bend_update().

int log_sessiondetail = 0
static

Definition at line 103 of file seshigh.c.

Referenced by get_logbits(), and ir_session().

int logbits_set = 0
static

Definition at line 101 of file seshigh.c.

Referenced by create_association(), and get_logbits().