summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorDamien Wedhorn <voip@facts.com.au>2011-10-10 00:36:02 +0000
committerDamien Wedhorn <voip@facts.com.au>2011-10-10 00:36:02 +0000
commitc5546e2bd7e49c9f51840bdbe454535f1d74be45 (patch)
tree55767a3f25b5b51e86acb3da5c5bf951f7e83503 /channels
parent0ac40dc255efad058f33413058d8db96eefc3f6c (diff)
Increase SKINNY_MAX_PACKET and add some logging.
Increase SKINNY_MAX_PACKET to 2000 bytes to handle some messages in v17 that are greater than the old 1000 bytes. Also add some useful logging regarding packet and session handling. A device (with protocol v17) was sending a packet with length greater than 1000 which resulted in the TCP session being destroyed and registration being retryed. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@340070 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_skinny.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index ec4d7b0f3..7c5ca907b 100644
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -166,7 +166,7 @@ enum skinny_codecs {
#define DEFAULT_SKINNY_PORT 2000
#define DEFAULT_SKINNY_BACKLOG 2
-#define SKINNY_MAX_PACKET 1000
+#define SKINNY_MAX_PACKET 2000
#define DEFAULT_AUTH_TIMEOUT 30
#define DEFAULT_AUTH_LIMIT 50
@@ -6862,6 +6862,7 @@ static int get_input(struct skinnysession *s)
return -1;
}
if (dlen+8 > sizeof(s->inbuf)) {
+ ast_log(LOG_WARNING, "Skinny packet too large (%d bytes), max length(%d bytes)\n", dlen+8, SKINNY_MAX_PACKET);
dlen = sizeof(s->inbuf) - 8;
}
*bufaddr = htolel(dlen);
@@ -6915,6 +6916,7 @@ static void *skinny_session(void *data)
for (;;) {
res = get_input(s);
if (res < 0) {
+ ast_verb(3, "Ending Skinny session from %s (bad input)\n", ast_inet_ntoa(s->sin.sin_addr));
break;
}
@@ -6922,6 +6924,7 @@ static void *skinny_session(void *data)
{
if (!(req = skinny_req_parse(s))) {
destroy_session(s);
+ ast_verb(3, "Ending Skinny session from %s (failed parse)\n", ast_inet_ntoa(s->sin.sin_addr));
return NULL;
}