Esempio n. 1
0
int
ZCompareALDPred(ZNotice_t *notice,
		void *zald)
{
    return(ZCompareUID(&(notice->z_multiuid),
		       &(((ZAsyncLocateData_t *) zald)->uid)));
}
Esempio n. 2
0
static Code_t
Z_SendAndWaitForServer(ZNotice_t *notice,
		       char *buf, int len,
		       int waitforack)
{
    Code_t retval;
    ZNotice_t retnotice;

    retval = ZSendPacket(buf, len, waitforack);
    if (retval != ZERR_NONE)
	return (retval);
    /* Z_ReadWait drops non-initial SERVACKs and SERVNAKs on the floor. We
       should never see a non-initial one here, but be defensive about bugs in the
       sharding code above. */
    if (!ZCompareUID(&notice->z_multiuid, &notice->z_uid))
	return (retval);
    if ((retval = ZIfNotice(&retnotice, (struct sockaddr_in *)0, 
				ZCompareUIDPred, (char *)&notice->z_uid)) !=
	ZERR_NONE)
	return (retval);
    if (retnotice.z_kind == SERVNAK) {
	ZFreeNotice(&retnotice);
	return (ZERR_SERVNAK);
    }
    if (retnotice.z_kind != SERVACK) {
	ZFreeNotice(&retnotice);
	return (ZERR_INTERNAL);
    }
    ZFreeNotice(&retnotice);
    return (ZERR_NONE);
}
Esempio n. 3
0
int
ZCompareMultiUIDPred(ZNotice_t *notice,
		     void *uid)
{
    return (ZCompareUID(&notice->z_multiuid, (ZUnique_Id_t *) uid));
}