|
|
@@ -67,6 +67,14 @@
|
|
|
#define MAX_UNSYNCED_POSTS 32
|
|
|
#endif
|
|
|
|
|
|
+#ifndef SERVER_RESPONSE_DELAY
|
|
|
+ #define SERVER_RESPONSE_DELAY 300
|
|
|
+#endif
|
|
|
+
|
|
|
+#ifndef TXT_ACK_DELAY
|
|
|
+ #define TXT_ACK_DELAY 200
|
|
|
+#endif
|
|
|
+
|
|
|
#ifdef DISPLAY_CLASS
|
|
|
#include "UITask.h"
|
|
|
static UITask ui_task(display);
|
|
|
@@ -568,12 +576,12 @@ protected:
|
|
|
mesh::Packet* ack = createAck(ack_hash);
|
|
|
if (ack) {
|
|
|
if (client->out_path_len < 0) {
|
|
|
- sendFlood(ack);
|
|
|
+ sendFlood(ack, TXT_ACK_DELAY);
|
|
|
} else {
|
|
|
- sendDirect(ack, client->out_path, client->out_path_len);
|
|
|
+ sendDirect(ack, client->out_path, client->out_path_len, TXT_ACK_DELAY);
|
|
|
}
|
|
|
}
|
|
|
- delay_millis = REPLY_DELAY_MILLIS;
|
|
|
+ delay_millis = TXT_ACK_DELAY + REPLY_DELAY_MILLIS;
|
|
|
} else {
|
|
|
delay_millis = 0;
|
|
|
}
|
|
|
@@ -592,9 +600,9 @@ protected:
|
|
|
auto reply = createDatagram(PAYLOAD_TYPE_TXT_MSG, client->id, secret, temp, 5 + text_len);
|
|
|
if (reply) {
|
|
|
if (client->out_path_len < 0) {
|
|
|
- sendFlood(reply, delay_millis);
|
|
|
+ sendFlood(reply, delay_millis + SERVER_RESPONSE_DELAY);
|
|
|
} else {
|
|
|
- sendDirect(reply, client->out_path, client->out_path_len, delay_millis);
|
|
|
+ sendDirect(reply, client->out_path, client->out_path_len, delay_millis + SERVER_RESPONSE_DELAY);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -637,7 +645,7 @@ protected:
|
|
|
auto reply = createAck(ack_hash);
|
|
|
if (reply) {
|
|
|
reply->payload[reply->payload_len++] = getUnsyncedCount(client); // NEW: add unsynced counter to end of ACK packet
|
|
|
- sendDirect(reply, client->out_path, client->out_path_len);
|
|
|
+ sendDirect(reply, client->out_path, client->out_path_len, SERVER_RESPONSE_DELAY);
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
@@ -647,14 +655,14 @@ protected:
|
|
|
// let this sender know path TO here, so they can use sendDirect(), and ALSO encode the response
|
|
|
mesh::Packet* path = createPathReturn(client->id, secret, packet->path, packet->path_len,
|
|
|
PAYLOAD_TYPE_RESPONSE, reply_data, reply_len);
|
|
|
- if (path) sendFlood(path);
|
|
|
+ if (path) sendFlood(path, SERVER_RESPONSE_DELAY);
|
|
|
} else {
|
|
|
mesh::Packet* reply = createDatagram(PAYLOAD_TYPE_RESPONSE, client->id, secret, reply_data, reply_len);
|
|
|
if (reply) {
|
|
|
if (client->out_path_len >= 0) { // we have an out_path, so send DIRECT
|
|
|
- sendDirect(reply, client->out_path, client->out_path_len);
|
|
|
+ sendDirect(reply, client->out_path, client->out_path_len, SERVER_RESPONSE_DELAY);
|
|
|
} else {
|
|
|
- sendFlood(reply);
|
|
|
+ sendFlood(reply, SERVER_RESPONSE_DELAY);
|
|
|
}
|
|
|
}
|
|
|
}
|