int ZCompareALDPred(ZNotice_t *notice, void *zald) { return(ZCompareUID(&(notice->z_multiuid), &(((ZAsyncLocateData_t *) zald)->uid))); }
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(¬ice->z_multiuid, ¬ice->z_uid)) return (retval); if ((retval = ZIfNotice(&retnotice, (struct sockaddr_in *)0, ZCompareUIDPred, (char *)¬ice->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); }
int ZCompareMultiUIDPred(ZNotice_t *notice, void *uid) { return (ZCompareUID(¬ice->z_multiuid, (ZUnique_Id_t *) uid)); }