Logo Search packages:      
Sourcecode: yaz version File versions

seshigh.c File Reference

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.

#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <assert.h>
#include <ctype.h>
#include <yaz/yconfig.h>
#include <yaz/xmalloc.h>
#include <yaz/comstack.h>
#include "eventl.h"
#include "session.h"
#include <yaz/proto.h>
#include <yaz/oid.h>
#include <yaz/log.h>
#include <yaz/logrpn.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/srw.h>
#include <yaz/backend.h>

Go to the source code of this file.


static void assoc_init_reset (association *assoc)
void backend_response (IOCHAN i, int event)
int bend_backend_respond (bend_association a, bend_request req)
void bend_request_destroy (bend_request *req)
void * bend_request_getdata (bend_request r)
Z_ReferenceId * bend_request_getid (ODR odr, bend_request req)
bend_request bend_request_mk (bend_association a)
void bend_request_send (bend_association a, bend_request req, Z_APDU *res)
void bend_request_setdata (bend_request r, void *p)
int bend_searchresponse (void *handle, bend_search_rr *bsrr)
association * create_association (IOCHAN channel, COMSTACK link)
void destroy_association (association *h)
static Z_Records * diagrec (association *assoc, int error, char *addinfo)
static void do_close (association *a, int reason, char *message)
static void do_close_req (association *a, int reason, char *message, request *req)
static void get_logbits ()
static Z_External * init_diagnostics (ODR odr, int errcode, const char *errstring)
void ir_session (IOCHAN h, int event)
static Z_Records * pack_records (association *a, char *setname, int start, int *num, Z_RecordComposition *comp, int *next, int *pres, oid_value format, Z_ReferenceId *referenceId, int *oid, int *errcode)
static void process_close (association *assoc, request *reqb)
static Z_APDU * process_deleteRequest (association *assoc, request *reqb, int *fd)
static Z_APDU * process_ESRequest (association *assoc, request *reqb, int *fd)
static void process_gdu_request (association *assoc, request *req)
static int process_gdu_response (association *assoc, request *req, Z_GDU *res)
static void process_http_request (association *assoc, request *req)
static Z_APDU * process_initRequest (association *assoc, request *reqb)
static Z_APDU * process_presentRequest (association *assoc, request *reqb, int *fd)
static Z_APDU * process_scanRequest (association *assoc, request *reqb, int *fd)
static Z_APDU * process_searchRequest (association *assoc, request *reqb, int *fd)
static Z_APDU * process_segmentRequest (association *assoc, request *reqb)
static Z_APDU * process_sortRequest (association *assoc, request *reqb, int *fd)
static int process_z_request (association *assoc, request *req, char **msg)
static int process_z_response (association *assoc, request *req, Z_APDU *res)
static Z_APDU * response_searchRequest (association *assoc, request *reqb, bend_search_rr *bsrr, int *fd)
void save_referenceId (request *reqb, Z_ReferenceId *refid)
static void srw_bend_explain (association *assoc, request *req, Z_SRW_explainRequest *srw_req, Z_SRW_explainResponse *srw_res, int *http_code)
static int srw_bend_fetch (association *assoc, int pos, Z_SRW_searchRetrieveRequest *srw_req, Z_SRW_record *record)
static int srw_bend_init (association *assoc)
static void srw_bend_search (association *assoc, request *req, Z_SRW_searchRetrieveRequest *srw_req, Z_SRW_searchRetrieveResponse *srw_res, int *http_code)
static Z_NamePlusRecord * surrogatediagrec (association *assoc, const char *dbname, int error, const char *addinfo)
static void wr_diag (WRBUF w, int error, const char *addinfo)


static FILE * apduf = 0
static statserv_options_block * control_block = 0
static int log_request = 0
static int log_requestdetail = 0
static int log_session = 0
static int logbits_set = 0

Generated by  Doxygen 1.6.0   Back to index