Skip to content

Commit

Permalink
Make resends less aggressive.
Browse files Browse the repository at this point in the history
We now limit resends to just 3 copies, both for requests and updates,
since there are enough mechanisms in the protocol to handle packet
loss.
  • Loading branch information
jech committed Feb 11, 2012
1 parent 4a86fd9 commit 6c86994
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions resend.c
Expand Up @@ -104,7 +104,7 @@ record_resend(int kind, const unsigned char *prefix, unsigned char plen,
else if(delay)
resend->delay = delay;
resend->time = now;
resend->max = kind == RESEND_REQUEST ? 128 : UPDATE_MAX;
resend->max = RESEND_MAX;
if(id && memcmp(resend->id, id, 8) == 0 &&
seqno_compare(resend->seqno, seqno) > 0) {
return 0;
Expand All @@ -121,7 +121,7 @@ record_resend(int kind, const unsigned char *prefix, unsigned char plen,
if(resend == NULL)
return -1;
resend->kind = kind;
resend->max = kind == RESEND_REQUEST ? 128 : UPDATE_MAX;
resend->max = RESEND_MAX;
resend->delay = delay;
memcpy(resend->prefix, prefix, 16);
resend->plen = plen;
Expand Down
2 changes: 1 addition & 1 deletion resend.h
Expand Up @@ -21,7 +21,7 @@ THE SOFTWARE.
*/

#define REQUEST_TIMEOUT 65000
#define UPDATE_MAX 4
#define RESEND_MAX 3

#define RESEND_REQUEST 1
#define RESEND_UPDATE 2
Expand Down

0 comments on commit 6c86994

Please sign in to comment.