Skip to content

Commit

Permalink
zcall: increase # of retries on OTR sending to allow users being quic…
Browse files Browse the repository at this point in the history
…kly added on the fly
  • Loading branch information
z-dule committed Sep 20, 2021
1 parent 99d8b3c commit 1c4aaad
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/engine/otr.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#define MAX_CLIENTS 8
#define MAX_ID_LEN 64
#define OTR_RETRIES 6

struct context {
struct engine *engine;
Expand Down Expand Up @@ -264,8 +265,11 @@ static int send_otr_if_ready(struct context *ctx, bool ignore_missing)
struct ctx_user *cu;
size_t i;

//info("send_otr_if_ready w:%s mp:%u rt:%d\n", ctx->waiting_for_otr ? "true" : "false",
// ctx->missing_prekeys, ctx->retries);
#if 0
info("send_otr_if_ready w:%s mp:%u rt:%d\n",
ctx->waiting_for_otr ? "true" : "false",
ctx->missing_prekeys, ctx->retries);
#endif

if (!ctx->waiting_for_otr && ctx->missing_prekeys == 0) {
if (--ctx->retries < 0) {
Expand Down Expand Up @@ -379,7 +383,7 @@ int engine_send_otr_message(struct engine *engine,
ctx->resph = resph;
ctx->arg = arg;
ctx->missing_prekeys = 0;
ctx->retries = 3;
ctx->retries = OTR_RETRIES;

if (targets && num_targets > 0) {
size_t tsz = num_targets * sizeof(struct otr_target);
Expand Down

0 comments on commit 1c4aaad

Please sign in to comment.