new_cmd->sent = 0;
new_cmd->tv_start.tv_sec = 0;
new_cmd->tv_start.tv_usec = 0;
- gettimeofday(&new_cmd->tv_start, NULL);
new_cmd->next = NULL;
if(!(*first)) {
return 0;
}
+void cmd_sent(cmd_t* cmd)
+{
+ if(!cmd)
+ return;
+
+ cmd->sent = 1;
+ gettimeofday(&cmd->tv_start, NULL);
+}
+
// timeout between 1 and 2 seconds
int cmd_has_expired(const cmd_t cmd)
{
typedef struct cmd_struct cmd_t;
int cmd_push(cmd_t** first, int fd, cmd_id_t cmd, const char* param);
+void cmd_sent(cmd_t* cmd);
int cmd_has_expired(const cmd_t cmd);
void cmd_pop(cmd_t** first);
void cmd_clear(cmd_t** first);