comparison libfdproto/messages.c @ 1248:c9a160b815ea

Fix issue with anscb in the p_sr expiry mechanism. Thanks Guangming for the report.
author Sebastien Decugis <sdecugis@freediameter.net>
date Fri, 22 Nov 2013 16:07:42 +0100
parents e72c9dad62ac
children 0f215b0dda5e
comparison
equal deleted inserted replaced
1247:2c09e2545188 1248:c9a160b815ea
1264 memcpy(&msg->msg_cb.timeout, timeout, sizeof(struct timespec)); 1264 memcpy(&msg->msg_cb.timeout, timeout, sizeof(struct timespec));
1265 } 1265 }
1266 } 1266 }
1267 1267
1268 return 0; 1268 return 0;
1269 } 1269 }
1270
1271 /* Remove a callback */
1272 int fd_msg_anscb_reset(struct msg * msg, int clear_anscb, int clear_expirecb)
1273 {
1274 TRACE_ENTRY("%p %d %d", msg, clear_anscb, clear_expirecb);
1275
1276 /* Check the parameters */
1277 CHECK_PARAMS( CHECK_MSG(msg) );
1278
1279 if (clear_anscb) {
1280 msg->msg_cb.anscb = NULL;
1281 msg->msg_cb.data = NULL;
1282 }
1283 if (clear_expirecb) {
1284 msg->msg_cb.expirecb = NULL;
1285 memset(&msg->msg_cb.timeout, 0, sizeof(struct timespec));
1286 }
1287
1288 return 0;
1289 }
1290
1270 1291
1271 int fd_msg_anscb_get( struct msg * msg, void (**anscb)(void *, struct msg **), void (**expirecb)(void *, DiamId_t, size_t, struct msg **), void ** data ) 1292 int fd_msg_anscb_get( struct msg * msg, void (**anscb)(void *, struct msg **), void (**expirecb)(void *, DiamId_t, size_t, struct msg **), void ** data )
1272 { 1293 {
1273 TRACE_ENTRY("%p %p %p %p", msg, anscb, expirecb, data); 1294 TRACE_ENTRY("%p %p %p %p", msg, anscb, expirecb, data);
1274 1295
"Welcome to our mercurial repository"