diff --git a/client.c b/client.c index a04dcb8..7d1e346 100644 --- a/client.c +++ b/client.c @@ -1347,15 +1347,15 @@ submit_request(CMD_Request *request, CMD_Reply *reply) new_attempt = 1; do { + if (gettimeofday(&tv, NULL)) + return 0; + if (new_attempt) { new_attempt = 0; if (n_attempts > max_retries) return 0; - if (gettimeofday(&tv, NULL)) - return 0; - UTI_TimevalToTimespec(&tv, &ts_start); UTI_GetRandomBytes(&request->sequence, sizeof (request->sequence)); @@ -1383,9 +1383,6 @@ submit_request(CMD_Request *request, CMD_Reply *reply) DEBUG_LOG("Sent %d bytes", command_length); } - if (gettimeofday(&tv, NULL)) - return 0; - UTI_TimevalToTimespec(&tv, &ts_now); /* Check if the clock wasn't stepped back */