From: Martin Johansson Date: Mon, 10 Sep 2012 20:47:13 +0000 (+0200) Subject: Reset timeout timer when receiving UDP data too. May fix timeout when using push... X-Git-Url: http://git.code-monkey.de/?p=umurmur.git;a=commitdiff_plain;h=6087b18a630eb32df682a7fd90d88408aa99c726 Reset timeout timer when receiving UDP data too. May fix timeout when using push-to-talk. Correct speling error. --- diff --git a/src/client.c b/src/client.c index 9f7576e..189836c 100644 --- a/src/client.c +++ b/src/client.c @@ -101,7 +101,7 @@ void Client_janitor() if (c->availableBandwidth > bwTop) c->availableBandwidth = bwTop; - if (Timer_isElapsed(&c->lastActivity, 1000000LL * INACTICITY_TIMEOUT)) { + if (Timer_isElapsed(&c->lastActivity, 1000000LL * INACTIVITY_TIMEOUT)) { /* No activity from client - assume it is lost and close. */ Log_info_client(c, "Timeout, closing."); Client_free(c); @@ -817,6 +817,7 @@ int Client_voiceMsg(client_t *client, uint8_t *data, int len) client->availableBandwidth -= packetsize; Timer_restart(&client->idleTime); + Timer_restart(&client->lastActivity); counter = Pds_get_numval(pdi); /* step past session id */ do { diff --git a/src/client.h b/src/client.h index 853a076..a3ce2c2 100644 --- a/src/client.h +++ b/src/client.h @@ -51,7 +51,7 @@ #define BUFSIZE 8192 #define UDP_BUFSIZE 512 -#define INACTICITY_TIMEOUT 15 /* Seconds */ +#define INACTIVITY_TIMEOUT 15 /* Seconds */ #define MAX_CODECS 10 #define MAX_TOKENSIZE 64 #define MAX_TOKENS 32