[23154] in Source-Commits
/svn/athena r22815 - trunk/athena/lib/zephyr/lib
daemon@ATHENA.MIT.EDU (ghudson@MIT.EDU)
Thu Apr 3 16:08:11 2008
Date: Thu, 3 Apr 2008 16:07:39 -0400 (EDT)
From: ghudson@MIT.EDU
Message-Id: <200804032007.QAA09069@drugstore.mit.edu>
To: source-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Author: ghudson
Date: 2008-04-03 16:07:38 -0400 (Thu, 03 Apr 2008)
New Revision: 22815
Modified:
trunk/athena/lib/zephyr/lib/ZLocations.c
Log:
From Karl Ramm: In libzephyr, fix a bug where Z_SendLocations would
process the wrong packet as an ack.
Modified: trunk/athena/lib/zephyr/lib/ZLocations.c
===================================================================
--- trunk/athena/lib/zephyr/lib/ZLocations.c 2008-04-03 17:51:46 UTC (rev 22814)
+++ trunk/athena/lib/zephyr/lib/ZLocations.c 2008-04-03 20:07:38 UTC (rev 22815)
@@ -93,6 +93,14 @@
return(NULL);
}
+/* lifted from lib/ZSendPkt.c wait_for_hmack, but waits for SERVACK instead */
+static int wait_for_srvack(notice, uid)
+ ZNotice_t *notice;
+ ZUnique_Id_t *uid;
+{
+ return (notice->z_kind == SERVACK && ZCompareUID(¬ice->z_uid, uid));
+}
+
Code_t Z_SendLocation(class, opcode, auth, format)
char *class;
char *opcode;
@@ -129,7 +137,7 @@
if ((retval = ZSendList(¬ice, bptr, 3, auth)) != ZERR_NONE)
return (retval);
- retval = Z_WaitForNotice (&retnotice, ZCompareUIDPred, ¬ice.z_uid,
+ retval = Z_WaitForNotice (&retnotice, wait_for_srvack, ¬ice.z_uid,
SRV_TIMEOUT);
if (retval != ZERR_NONE)
return retval;