Skip to content

Commit

Permalink
* MDF [mqtt_client] use duration instead of size_t to set retry interval
Browse files Browse the repository at this point in the history
  • Loading branch information
JaylinYu committed Jul 21, 2023
1 parent f003ed5 commit 3d31624
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/mqtt/protocol/mqtt/mqtt_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,16 @@ mqtt_sock_get_sqlite_option(mqtt_sock_t *s)
}

static int
mqtt_sock_set_retry_interval(void *arg, void *v, size_t sz, nni_opt_type t)
mqtt_sock_set_retry_interval(void *arg, const void *v, size_t sz, nni_opt_type t)
{
mqtt_sock_t *s = arg;
int val;
int rv;
if ((rv = nni_copyin_int(&val, v, sz, 0, sizeof(s->retry), t)) == 0) {
s->retry = val * NNI_SECOND;
nni_duration tmp;
int rv;

if ((rv = nni_copyin_ms(&tmp, v, sz, t)) == 0) {
s->retry = tmp > 600000 ? 360000 : tmp;
}
return rv;
return (rv);
}

static int
Expand Down

0 comments on commit 3d31624

Please sign in to comment.