-/* $Id: zserver.c,v 1.117.2.2 2005-01-16 23:13:29 adam Exp $
+/* $Id: zserver.c,v 1.117.2.5 2005-11-07 12:53:47 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
}
if (zebra_auth (zh, user, passwd))
{
- r->errcode = 222;
+ r->errcode = 1011; /* Init/AC: Bad user ID or password */
r->errstring = user;
return r;
}
Z_IUUpdateEsRequest *esRequest = up->u.esRequest;
Z_IUOriginPartToKeep *toKeep = esRequest->toKeep;
Z_IUSuppliedRecords *notToKeep = esRequest->notToKeep;
+ int res;
yaz_log (LOG_LOG, "action");
if (toKeep->action)
rr->errstring = "database";
return 0;
}
- if (notToKeep)
+ res = zebra_begin_trans (zh, 1);
+ if (res) /* zebra_trans_failed ? */
+ zebra_result(zh, &rr->errcode, &rr->errstring);
+ else
{
int i;
- zebra_begin_trans (zh, 1);
- for (i = 0; i < notToKeep->num; i++)
+ for (i = 0; notToKeep && i < notToKeep->num; i++)
{
Z_External *rec = notToKeep->elements[i]->record;
struct oident *oident = 0;
}
}
}
- zebra_end_trans (zh);
+ zebra_end_trans (zh);
}
}
}