Skinny: Check for socket to see if listener is alive

also, use tab to indent
This commit is contained in:
Mathieu Parent 2010-04-01 19:50:55 +02:00
parent 542f643ef5
commit 54e73c774f
6 changed files with 2454 additions and 2453 deletions

View File

@ -1003,6 +1003,7 @@ uint8_t listener_is_ready(listener_t *listener)
{ {
return globals.running return globals.running
&& listener && listener
&& listener->sock
&& switch_test_flag(listener, LFLAG_RUNNING) && switch_test_flag(listener, LFLAG_RUNNING)
&& listener->profile->listener_ready; && listener->profile->listener_ready;
} }

View File

@ -148,7 +148,7 @@ switch_status_t skinny_read_packet(listener_t *listener, skinny_message_t **req)
ptr = mbuf; ptr = mbuf;
while (listener->sock && listener_is_ready(listener)) { while (listener_is_ready(listener)) {
uint8_t do_sleep = 1; uint8_t do_sleep = 1;
if(bytes < SKINNY_MESSAGE_FIELD_SIZE) { if(bytes < SKINNY_MESSAGE_FIELD_SIZE) {
/* We have nothing yet, get length header field */ /* We have nothing yet, get length header field */