Changeset 1248:c9a160b815ea in freeDiameter
- Timestamp:
- Nov 23, 2013, 12:07:42 AM (10 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
include/freeDiameter/libfdproto.h
r1243 r1248 2489 2489 int fd_msg_anscb_associate( struct msg * msg, void ( *anscb)(void *, struct msg **), void * data, void (*expirecb)(void *, DiamId_t, size_t, struct msg **), const struct timespec *timeout ); 2490 2490 int fd_msg_anscb_get( struct msg * msg, void (**anscb)(void *, struct msg **), void (**expirecb)(void *, DiamId_t, size_t, struct msg **), void ** data ); 2491 int fd_msg_anscb_reset(struct msg * msg, int clear_anscb, int clear_expirecb); 2491 2492 struct timespec *fd_msg_anscb_gettimeout( struct msg * msg ); /* returns NULL or a valid non-0 timespec */ 2492 2493 -
libfdcore/p_sr.c
r1240 r1248 117 117 struct fd_peer * sentto; 118 118 void (*expirecb)(void *, DiamId_t, size_t, struct msg **); 119 void (*anscb)(void *, struct msg **);120 119 void * data; 121 120 int no_error; … … 177 176 178 177 /* Retrieve callback in the message */ 179 CHECK_FCT_DO( fd_msg_anscb_get( request, &anscb, &expirecb, &data ), break);178 CHECK_FCT_DO( fd_msg_anscb_get( request, NULL, &expirecb, &data ), break); 180 179 ASSERT(expirecb); 181 180 182 181 /* Clean up this expirecb from the message */ 183 CHECK_FCT_DO( fd_msg_anscb_ associate( request, anscb, data, NULL, NULL), break);182 CHECK_FCT_DO( fd_msg_anscb_reset( request, 0, 1 ), break); 184 183 185 184 /* Call it */ -
libfdproto/messages.c
r1230 r1248 1267 1267 1268 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 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 )
Note: See TracChangeset
for help on using the changeset viewer.