205 |
/* Queue this command */ |
/* Queue this command */ |
206 |
struct Command *cmd = command_create(tab, param, source_p, target); |
struct Command *cmd = command_create(tab, param, source_p, target); |
207 |
|
|
208 |
list_add(&COMMANDS, &cmd->node); |
list_add(&COMMANDS, node_create(cmd)); |
209 |
break; |
break; |
210 |
} |
} |
211 |
} |
} |
243 |
|
|
244 |
if ((present - command->added) > OptionsItem->command_timeout) |
if ((present - command->added) > OptionsItem->command_timeout) |
245 |
{ |
{ |
|
list_remove(&COMMANDS, &command->node); |
|
246 |
command_free(command); |
command_free(command); |
247 |
|
list_remove(&COMMANDS, node); |
248 |
|
node_free(node); |
249 |
} |
} |
250 |
else /* Since the queue is in order, it's also ordered by time, no nodes after this will be timed out */ |
else /* Since the queue is in order, it's also ordered by time, no nodes after this will be timed out */ |
251 |
return; |
return; |
298 |
command->tab->handler(command->param, command->target); |
command->tab->handler(command->param, command->target); |
299 |
|
|
300 |
/* Cleanup the command */ |
/* Cleanup the command */ |
|
list_remove(&COMMANDS, &command->node); |
|
301 |
command_free(command); |
command_free(command); |
302 |
|
list_remove(&COMMANDS, node); |
303 |
|
node_free(node); |
304 |
} |
} |
305 |
} |
} |
306 |
} |
} |