]> git.scottworley.com Git - tattlekey/blobdiff - client/tattlekey.c
client: Exponential backoff resend intervals
[tattlekey] / client / tattlekey.c
index 9af9b5aef2f12e8e7147035f844af1d8aac557ef..c38de126d50245cd3a9ba08d128e170b6c23d75c 100644 (file)
@@ -14,7 +14,9 @@ typedef struct {
   u8_t send_count;
 } send_t;
 
-uint32_t next_send(send_t *s) { return s->timestamp + s->send_count; }
+uint32_t next_send(send_t *s) {
+  return s->timestamp + (1 << s->send_count) - 1;
+}
 
 bool next_send_less_than(void *user_data, pheap_node_id_t a,
                          pheap_node_id_t b) {