X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=server%2Fseshigh.c;h=57389f2a873551a545e0fe5f7b63feb164e2329a;hb=55c6ac70550af857d80ef233147dbc986e4095e1;hp=c74de0ce3511ac4222899e01ee7d5846d25c4883;hpb=8fcf022b257ac4321f13dd1b9045a01d1535992b;p=yaz-moved-to-github.git diff --git a/server/seshigh.c b/server/seshigh.c index c74de0c..57389f2 100644 --- a/server/seshigh.c +++ b/server/seshigh.c @@ -4,7 +4,17 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: seshigh.c,v $ - * Revision 1.66 1997-09-05 15:26:44 adam + * Revision 1.69 1997-09-30 11:48:12 adam + * Fixed bug introduced by previous commit. + * + * Revision 1.68 1997/09/29 13:18:59 adam + * Added function, oid_ent_to_oid, to replace the function + * oid_getoidbyent, which is not thread safe. + * + * Revision 1.67 1997/09/17 12:10:40 adam + * YAZ version 1.4. + * + * Revision 1.66 1997/09/05 15:26:44 adam * Added ODR encode in search and scen bend request structures. * Fixed a few enums that caused trouble with C++. * @@ -670,6 +680,7 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb) if (req->implementationVersion) logf(LOG_LOG, "Version: %s", req->implementationVersion); + binitreq.stream = assoc->encode; binitreq.configname = "default-config"; binitreq.auth = req->idAuthentication; if (!(binitres = bend_init(&binitreq))) @@ -760,6 +771,7 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb) */ static Z_Records *diagrec(association *assoc, int error, char *addinfo) { + int oid[OID_SIZE]; Z_Records *rec = odr_malloc (assoc->encode, sizeof(*rec)); oident bib1; int *err = odr_malloc (assoc->encode, sizeof(*err)); @@ -781,7 +793,8 @@ static Z_Records *diagrec(association *assoc, int error, char *addinfo) #else rec->u.nonSurrogateDiagnostic = dr; #endif - dr->diagnosticSetId = oid_getoidbyent(&bib1); + dr->diagnosticSetId = odr_oiddup (assoc->encode, + oid_ent_to_oid(&bib1, oid)); dr->condition = err; dr->which = Z_DiagForm_v2AddInfo; dr->addinfo = addinfo ? addinfo : ""; @@ -794,6 +807,7 @@ static Z_Records *diagrec(association *assoc, int error, char *addinfo) static Z_NamePlusRecord *surrogatediagrec(association *assoc, char *dbname, int error, char *addinfo) { + int oid[OID_SIZE]; Z_NamePlusRecord *rec = odr_malloc (assoc->encode, sizeof(*rec)); int *err = odr_malloc (assoc->encode, sizeof(*err)); oident bib1; @@ -811,7 +825,8 @@ static Z_NamePlusRecord *surrogatediagrec(association *assoc, char *dbname, rec->u.surrogateDiagnostic = drec; drec->which = Z_DiagRec_defaultFormat; drec->u.defaultFormat = dr; - dr->diagnosticSetId = oid_getoidbyent(&bib1); + dr->diagnosticSetId = odr_oiddup (assoc->encode, + oid_ent_to_oid(&bib1, oid)); dr->condition = err; dr->which = Z_DiagForm_v2AddInfo; dr->addinfo = addinfo ? addinfo : ""; @@ -823,6 +838,7 @@ static Z_NamePlusRecord *surrogatediagrec(association *assoc, char *dbname, */ static Z_DiagRecs *diagrecs(association *assoc, int error, char *addinfo) { + int oid[OID_SIZE]; Z_DiagRecs *recs = odr_malloc (assoc->encode, sizeof(*recs)); int *err = odr_malloc (assoc->encode, sizeof(*err)); oident bib1; @@ -842,7 +858,8 @@ static Z_DiagRecs *diagrecs(association *assoc, int error, char *addinfo) drec->which = Z_DiagRec_defaultFormat; drec->u.defaultFormat = rec; - rec->diagnosticSetId = oid_getoidbyent(&bib1); + rec->diagnosticSetId = odr_oiddup (assoc->encode, + oid_ent_to_oid(&bib1, oid)); rec->condition = err; rec->which = Z_DiagForm_v2AddInfo; rec->addinfo = addinfo ? addinfo : ""; @@ -853,6 +870,7 @@ static Z_Records *pack_records(association *a, char *setname, int start, int *num, Z_RecordComposition *comp, int *next, int *pres, oid_value format) { + int oid[OID_SIZE]; int recno, total_length = 0, toget = *num, dumped_records = 0; Z_Records *records = odr_malloc (a->encode, sizeof(*records)); Z_NamePlusRecordList *reclist = odr_malloc (a->encode, sizeof(*reclist)); @@ -956,7 +974,7 @@ static Z_Records *pack_records(association *a, char *setname, int start, recform.oclass = CLASS_RECSYN; recform.value = fres->format; thisext->direct_reference = odr_oiddup(a->encode, - oid_getoidbyent(&recform)); + oid_ent_to_oid(&recform, oid)); thisext->indirect_reference = 0; thisext->descriptor = 0; if (fres->len < 0) /* Structured data */