- if(!c->reapable) {
- utcp_expect_data(c, offline);
-
- // If we are online again, reset the retransmission timers, but keep the connection timeout as it is,
- // to prevent peers toggling online/offline state frequently from keeping connections alive
- // if there is no progress in sending actual data.
- if(!offline) {
- gettimeofday(&utcp->connections[i]->rtrx_timeout, NULL);
- utcp->connections[i]->rtt_start.tv_sec = 0;
+ if(c->reapable) {
+ continue;
+ }
+
+ utcp_expect_data(c, offline);
+
+ if(!offline) {
+ if(timerisset(&c->rtrx_timeout)) {
+ c->rtrx_timeout = now;