* Sebastian Hammer, Adam Dickmeiss
*
* $Log: seshigh.c,v $
- * Revision 1.74 1998-03-31 15:13:20 adam
+ * Revision 1.76 1998-05-27 16:57:07 adam
+ * Support for surrogate diagnostic records added for bend_fetch.
+ *
+ * Revision 1.75 1998/05/18 10:13:07 adam
+ * Fixed call to es_request handler - extra argument was passed.
+ *
+ * Revision 1.74 1998/03/31 15:13:20 adam
* Development towards compiled ASN.1.
*
* Revision 1.73 1998/03/31 11:07:45 adam
req->response = odr_getbuf(assoc->encode, &req->len_response,
&req->size_response);
odr_setbuf(assoc->encode, 0, 0, 0); /* don'txfree if we abort later */
- odr_reset(assoc->encode);
if (assoc->print && !z_APDU(assoc->print, &res, 0))
{
logf(LOG_WARN, "ODR print error: %s",
odr_errmsg(odr_geterror(assoc->print)));
odr_reset(assoc->print);
}
+ odr_reset(assoc->encode);
req->state = REQUEST_IDLE;
request_enq(&assoc->outgoing, req);
/* turn the work over to the ir_session handler */
* surrogate diagnostic.
*/
static Z_NamePlusRecord *surrogatediagrec(association *assoc, char *dbname,
- int error, char *addinfo)
+ int error, char *addinfo)
{
int oid[OID_SIZE];
Z_NamePlusRecord *rec = (Z_NamePlusRecord *)odr_malloc (assoc->encode, sizeof(*rec));
bend_fetchresult *fres;
Z_NamePlusRecord *thisrec;
Z_DatabaseRecord *thisext;
- int this_length;
+ int this_length = 0;
/*
* we get the number of bytes allocated on the stream before any
freq.comp = comp;
freq.format = format;
freq.stream = a->encode;
+ freq.surrogate_flag = 0;
if (!(fres = bend_fetch(a->backend, &freq, 0)))
{
*pres = Z_PRES_FAILURE;
or only pertaining to current record */
if (fres->errcode)
{
- *pres = Z_PRES_FAILURE;
- return diagrec(a, fres->errcode, fres->errstring);
+ if (!freq.surrogate_flag)
+ {
+ *pres = Z_PRES_FAILURE;
+ return diagrec(a, fres->errcode, fres->errstring);
+ }
+ reclist->records[reclist->num_records] =
+ surrogatediagrec(a, fres->basename, fres->errcode,
+ fres->errstring);
+ reclist->num_records++;
+ *next = fres->last_in_set ? 0 : recno + 1;
+ continue;
}
if (fres->len >= 0)
this_length = fres->len;
continue;
}
}
+
if (!(thisrec = (Z_NamePlusRecord *)odr_malloc(a->encode, sizeof(*thisrec))))
return 0;
if (!(thisrec->databaseName = (char *)odr_malloc(a->encode,
esrequest.stream = assoc->encode;
esrequest.errcode = 0;
esrequest.errstring = NULL;
- esrequest.request = reqb;
- esrequest.association = assoc;
-
- (*assoc->bend_esrequest)(assoc->backend, &esrequest, fd);
-
+ esrequest.request = reqb;
+ esrequest.association = assoc;
+
+ ((int (*)(void *, bend_esrequest_rr *))(*assoc->bend_esrequest))(assoc->backend,
+ &esrequest);
+
/* If the response is being delayed, return NULL */
if (esrequest.request == NULL)
return(NULL);