From: Sebastian Hammer Date: Thu, 20 Apr 1995 15:12:44 +0000 (+0000) Subject: Cosmetic X-Git-Tag: YAZ.1.8~1058 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=b200b3ce30a8db1d68b2ddfe9994acff1a5d2789 Cosmetic --- diff --git a/include/comstack.h b/include/comstack.h index 9d13f2b..59ed215 100644 --- a/include/comstack.h +++ b/include/comstack.h @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: comstack.h,v $ - * Revision 1.2 1995-04-17 11:28:17 quinn + * Revision 1.3 1995-04-20 15:12:44 quinn + * Cosmetic + * + * Revision 1.2 1995/04/17 11:28:17 quinn * Smallish * * Revision 1.1 1995/03/30 09:39:40 quinn @@ -58,7 +61,6 @@ struct comstack; typedef struct comstack *COMSTACK; - typedef COMSTACK (*CS_TYPE)(int blocking, int protocol); struct comstack diff --git a/server/seshigh.c b/server/seshigh.c index 3edeba7..b28469f 100644 --- a/server/seshigh.c +++ b/server/seshigh.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: seshigh.c,v $ - * Revision 1.19 1995-04-18 08:15:34 quinn + * Revision 1.20 1995-04-20 15:13:00 quinn + * Cosmetic + * + * Revision 1.19 1995/04/18 08:15:34 quinn * Added dynamic memory allocation on encoding (whew). Code is now somewhat * neater. We'll make the same change for decoding one day. * @@ -79,7 +82,7 @@ #include -#define MAXRECORDSIZE 1024*1024 +#define MAXRECORDSIZE 1024*1024*5 /* should be configurable, of course */ static int process_apdu(IOCHAN chan); static int process_initRequest(IOCHAN client, Z_InitRequest *req); @@ -92,6 +95,12 @@ extern char *apdufile; static FILE *apduf = 0; /* for use in static mode */ +/* + * Create a new association-handle. + * channel : iochannel for the current line. + * link : communications channel. + * Returns: 0 or a new association handle. + */ association *create_association(IOCHAN channel, COMSTACK link) { association *new; @@ -141,7 +150,6 @@ association *create_association(IOCHAN channel, COMSTACK link) } else new->print = 0; - new->state = ASSOC_UNINIT; new->input_buffer = 0; new->input_buffer_len = 0; new->backend = 0; @@ -152,6 +160,9 @@ association *create_association(IOCHAN channel, COMSTACK link) return new; } +/* + * Free association and release resources. + */ void destroy_association(association *h) { odr_destroy(h->decode); @@ -166,7 +177,10 @@ void destroy_association(association *h) } /* - * process events on the association + * process events on the association. Called when the event loop detects an + * event. + * h : the I/O channel that has an outstanding event. + * event : the current outstanding event. */ void ir_session(IOCHAN h, int event) { @@ -225,6 +239,9 @@ void ir_session(IOCHAN h, int event) } } +/* + * Process the current outstanding APDU. + */ static int process_apdu(IOCHAN chan) { Z_APDU *apdu; @@ -314,10 +331,6 @@ static int process_initRequest(IOCHAN client, Z_InitRequest *req) ODR_MASK_SET(&protocolVersion, Z_ProtocolVersion_2); resp.protocolVersion = &protocolVersion; assoc->maximumRecordSize = *req->maximumRecordSize; - /* - * This is not so hot. The big todo for ODR is dynamic memory allocation - * on encoding. - */ if (assoc->maximumRecordSize > MAXRECORDSIZE) assoc->maximumRecordSize = MAXRECORDSIZE; assoc->preferredMessageSize = *req->preferredMessageSize; @@ -328,7 +341,7 @@ static int process_initRequest(IOCHAN client, Z_InitRequest *req) resp.result = &result; resp.implementationId = "YAZ"; resp.implementationName = "Index Data/YAZ Generic Frontend Server"; - resp.implementationVersion = "$Revision: 1.19 $"; + resp.implementationVersion = "$Revision: 1.20 $"; resp.userInformationField = 0; if (!z_APDU(assoc->encode, &apdup, 0)) { diff --git a/server/session.h b/server/session.h index 0ab672a..b36448a 100644 --- a/server/session.h +++ b/server/session.h @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: session.h,v $ - * Revision 1.4 1995-04-10 10:23:39 quinn + * Revision 1.5 1995-04-20 15:13:01 quinn + * Cosmetic + * + * Revision 1.4 1995/04/10 10:23:39 quinn * Some work to add scan and other things. * * Revision 1.3 1995/03/30 09:09:27 quinn @@ -27,27 +30,25 @@ #include #include +/* + * association state. + */ typedef struct association { - /* comms-related handles */ - IOCHAN client_chan; - COMSTACK client_link; - ODR decode; - ODR encode; - ODR print; - char *encode_buffer; - int encoded_len; - char *input_buffer; - int input_buffer_len; - int input_apdu_len; - int state; - oid_proto proto; - void *backend; -#define ASSOC_UNINIT 0 -#define ASSOC_IDLE 1 + IOCHAN client_chan; /* event-loop control */ + COMSTACK client_link; /* communication handle */ + ODR decode; /* decoding stream */ + ODR encode; /* encoding stream */ + ODR print; /* printing stream (for -a) */ + char *encode_buffer; /* temporary holding of encoded data */ + int encoded_len; /* length of encoded data */ + char *input_buffer; /* input buffer (allocated by comstack) */ + int input_buffer_len; /* length (size) of buffer */ + int input_apdu_len; /* length of current incoming APDU */ + oid_proto proto; /* protocol (PROTO_Z3950/PROTO_SR) */ + void *backend; /* backend handle */ - /* session parameters */ - int preferredMessageSize; + int preferredMessageSize; /* session parameters */ int maximumRecordSize; } association;