[retry] Hold reference while timer is running and during expiry callback
Guarantee that a retry timer cannot go out of scope while the timer is running, and provide a guarantee to the expiry callback that the timer will remain in scope during the entire callback (similar to the guarantee provided to interface methods). Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
+4
-2
@@ -695,8 +695,10 @@ static int slam_open ( struct interface *xfer, struct uri *uri ) {
|
||||
intf_init ( &slam->xfer, &slam_xfer_desc, &slam->refcnt );
|
||||
intf_init ( &slam->socket, &slam_socket_desc, &slam->refcnt );
|
||||
intf_init ( &slam->mc_socket, &slam_mc_socket_desc, &slam->refcnt );
|
||||
timer_init ( &slam->master_timer, slam_master_timer_expired );
|
||||
timer_init ( &slam->slave_timer, slam_slave_timer_expired );
|
||||
timer_init ( &slam->master_timer, slam_master_timer_expired,
|
||||
&slam->refcnt );
|
||||
timer_init ( &slam->slave_timer, slam_slave_timer_expired,
|
||||
&slam->refcnt );
|
||||
/* Fake an invalid cached header of { 0x00, ... } */
|
||||
slam->header_len = 1;
|
||||
/* Fake parameters for initial NACK */
|
||||
|
||||
Reference in New Issue
Block a user