{
Z_ReferenceId **id_from = get_referenceIdP(from);
Z_ReferenceId **id_to = get_referenceIdP(to);
- if (id_from && *id_from && id_to)
+ if (id_to)
{
- *id_to = (Z_ReferenceId*) odr_malloc(m_p->odr_out, sizeof(**id_to));
- (*id_to)->size = (*id_to)->len = (*id_from)->len;
- (*id_to)->buf = (unsigned char*)
- odr_malloc(m_p->odr_out, (*id_to)->len);
- memcpy((*id_to)->buf, (*id_from)->buf, (*id_to)->len);
+ if (id_from && *id_from)
+ *id_to = odr_create_Odr_oct(m_p->odr_out, (*id_from)->buf,
+ (*id_from)->len);
+ else
+ *id_to = 0;
}
- else if (id_to)
- *id_to = 0;
}
int Z_Assoc::send_Z_PDU(Z_APDU *apdu, int *plen)
Z_ReferenceId* id = NULL;
if (str)
- {
- id = (Z_ReferenceId*) odr_malloc(m_p->odr_out, sizeof(*id));
- id->size = id->len = strlen(str);
- id->buf = (unsigned char *) str;
- }
+ id = odr_create_Odr_oct(m_p->odr_out, str, strlen(str));
return id;
}
#include <yaz/otherinfo.h>
#include <yaz/charneg.h>
#include <yaz/log.h>
+#include <yaz/odr.h>
#include <zlint.h>
Z_ReferenceId *Zlint::mk_refid(const char *buf, int len)
{
- Z_ReferenceId *id =
- (Z_ReferenceId *) odr_malloc(odr_encode(), sizeof(*id));
- id->size = id->len = len;
- id->buf = (unsigned char*) odr_malloc(odr_encode(), len);
- memcpy(id->buf, buf, len);
- return id;
+ return odr_create_Odr_oct(odr_encode(), buf, len);
}
int Zlint::initResponseGetVersion(Z_InitResponse *init)