mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-13 12:40:17 +00:00
Skinny: Milestone 0 : no-op module (listeners and base skinny parsing)
Check for huge message git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16748 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
bf64b0962b
commit
0117bdd936
@ -621,10 +621,16 @@ static switch_status_t skinny_read_packet(listener_t *listener, skinny_message_t
|
|||||||
request->length,request->reserved,request->type);
|
request->length,request->reserved,request->type);
|
||||||
if(request->length < SKINNY_MESSAGE_FIELD_SIZE) {
|
if(request->length < SKINNY_MESSAGE_FIELD_SIZE) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
|
||||||
"Skinny client sent invalid data. Length should be greated than 4 but got %d.\n",
|
"Skinny client sent invalid data. Length should be greater than 4 but got %d.\n",
|
||||||
request->length);
|
request->length);
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
if(request->length + 2*SKINNY_MESSAGE_FIELD_SIZE > SKINNY_MESSAGE_MAXSIZE) {
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
|
||||||
|
"Skinny client sent too huge data. Got %d which is above threshold %d.\n",
|
||||||
|
request->length, SKINNY_MESSAGE_MAXSIZE - 2*SKINNY_MESSAGE_FIELD_SIZE);
|
||||||
|
return SWITCH_STATUS_FALSE;
|
||||||
|
}
|
||||||
if(bytes >= request->length + 2*SKINNY_MESSAGE_FIELD_SIZE) {
|
if(bytes >= request->length + 2*SKINNY_MESSAGE_FIELD_SIZE) {
|
||||||
/* Message body */
|
/* Message body */
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user