mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-17 17:22:21 +00:00
more cleanup
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5800 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
cb121ce376
commit
f82e478cb5
@ -274,6 +274,44 @@ void switch_core_state_machine_init(switch_memory_pool_t *pool)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define STATE_MACRO(__STATE, __STATE_STR) do { \
|
||||||
|
midstate = state; \
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) State %s\n", switch_channel_get_name(session->channel), __STATE_STR); \
|
||||||
|
if (!driver_state_handler->on_##__STATE || (driver_state_handler->on_##__STATE(session) == SWITCH_STATUS_SUCCESS \
|
||||||
|
&& midstate == switch_channel_get_state(session->channel))) { \
|
||||||
|
while ((application_state_handler = switch_channel_get_state_handler(session->channel, index++)) != 0) { \
|
||||||
|
if (!application_state_handler || !application_state_handler->on_##__STATE \
|
||||||
|
|| (application_state_handler->on_##__STATE \
|
||||||
|
&& application_state_handler->on_##__STATE(session) == SWITCH_STATUS_SUCCESS \
|
||||||
|
&& midstate == switch_channel_get_state(session->channel))) { \
|
||||||
|
proceed++; \
|
||||||
|
continue; \
|
||||||
|
} else { \
|
||||||
|
proceed = 0; \
|
||||||
|
break; \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
index = 0; \
|
||||||
|
while (proceed && (application_state_handler = switch_core_get_state_handler(index++)) != 0) { \
|
||||||
|
if (!application_state_handler || !application_state_handler->on_##__STATE || \
|
||||||
|
(application_state_handler->on_##__STATE && \
|
||||||
|
application_state_handler->on_##__STATE(session) == SWITCH_STATUS_SUCCESS \
|
||||||
|
&& midstate == switch_channel_get_state(session->channel))) { \
|
||||||
|
proceed++; \
|
||||||
|
continue; \
|
||||||
|
} else { \
|
||||||
|
proceed = 0; \
|
||||||
|
break; \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
if (proceed) { \
|
||||||
|
switch_core_standard_on_##__STATE(session); \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session)
|
SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session)
|
||||||
{
|
{
|
||||||
switch_channel_state_t state = CS_NEW, laststate = CS_HANGUP, midstate = CS_DONE, endstate;
|
switch_channel_state_t state = CS_NEW, laststate = CS_HANGUP, midstate = CS_DONE, endstate;
|
||||||
@ -343,7 +381,7 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session)
|
|||||||
if (state != laststate || state == CS_HANGUP || exception) {
|
if (state != laststate || state == CS_HANGUP || exception) {
|
||||||
int index = 0;
|
int index = 0;
|
||||||
int proceed = 1;
|
int proceed = 1;
|
||||||
midstate = state;
|
|
||||||
|
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case CS_NEW: /* Just created, Waiting for first instructions */
|
case CS_NEW: /* Just created, Waiting for first instructions */
|
||||||
@ -352,326 +390,31 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session)
|
|||||||
case CS_DONE:
|
case CS_DONE:
|
||||||
goto done;
|
goto done;
|
||||||
case CS_HANGUP: /* Deactivate and end the thread */
|
case CS_HANGUP: /* Deactivate and end the thread */
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) State HANGUP\n", switch_channel_get_name(session->channel));
|
STATE_MACRO(hangup, "HANGUP");
|
||||||
if (!driver_state_handler->on_hangup
|
|
||||||
|| (driver_state_handler->on_hangup
|
|
||||||
&& driver_state_handler->on_hangup(session) == SWITCH_STATUS_SUCCESS && midstate == switch_channel_get_state(session->channel))) {
|
|
||||||
while ((application_state_handler = switch_channel_get_state_handler(session->channel, index++)) != 0) {
|
|
||||||
if (!application_state_handler || !application_state_handler->on_hangup
|
|
||||||
|| (application_state_handler->on_hangup
|
|
||||||
&& application_state_handler->on_hangup(session) == SWITCH_STATUS_SUCCESS
|
|
||||||
&& midstate == switch_channel_get_state(session->channel))) {
|
|
||||||
proceed++;
|
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
proceed = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
index = 0;
|
|
||||||
while (proceed && (application_state_handler = switch_core_get_state_handler(index++)) != 0) {
|
|
||||||
if (!application_state_handler || !application_state_handler->on_hangup ||
|
|
||||||
(application_state_handler->on_hangup &&
|
|
||||||
application_state_handler->on_hangup(session) == SWITCH_STATUS_SUCCESS &&
|
|
||||||
midstate == switch_channel_get_state(session->channel))) {
|
|
||||||
proceed++;
|
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
proceed = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (proceed) {
|
|
||||||
switch_core_standard_on_hangup(session);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
goto done;
|
goto done;
|
||||||
case CS_INIT: /* Basic setup tasks */
|
case CS_INIT: /* Basic setup tasks */
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) State INIT\n", switch_channel_get_name(session->channel));
|
STATE_MACRO(init, "INIT");
|
||||||
if (!driver_state_handler->on_init
|
|
||||||
|| (driver_state_handler->on_init && driver_state_handler->on_init(session) == SWITCH_STATUS_SUCCESS
|
|
||||||
&& midstate == switch_channel_get_state(session->channel))) {
|
|
||||||
while ((application_state_handler = switch_channel_get_state_handler(session->channel, index++)) != 0) {
|
|
||||||
if (!application_state_handler || !application_state_handler->on_init
|
|
||||||
|| (application_state_handler->on_init
|
|
||||||
&& application_state_handler->on_init(session) == SWITCH_STATUS_SUCCESS
|
|
||||||
&& midstate == switch_channel_get_state(session->channel))) {
|
|
||||||
proceed++;
|
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
proceed = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
index = 0;
|
|
||||||
while (proceed && (application_state_handler = switch_core_get_state_handler(index++)) != 0) {
|
|
||||||
if (!application_state_handler || !application_state_handler->on_init ||
|
|
||||||
(application_state_handler->on_init &&
|
|
||||||
application_state_handler->on_init(session) == SWITCH_STATUS_SUCCESS
|
|
||||||
&& midstate == switch_channel_get_state(session->channel))) {
|
|
||||||
proceed++;
|
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
proceed = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (proceed) {
|
|
||||||
switch_core_standard_on_init(session);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case CS_RING: /* Look for a dialplan and find something to do */
|
case CS_RING: /* Look for a dialplan and find something to do */
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) State RING\n", switch_channel_get_name(session->channel));
|
STATE_MACRO(ring, "RING");
|
||||||
if (!driver_state_handler->on_ring
|
|
||||||
|| (driver_state_handler->on_ring && driver_state_handler->on_ring(session) == SWITCH_STATUS_SUCCESS
|
|
||||||
&& midstate == switch_channel_get_state(session->channel))) {
|
|
||||||
while ((application_state_handler = switch_channel_get_state_handler(session->channel, index++)) != 0) {
|
|
||||||
if (!application_state_handler || !application_state_handler->on_ring
|
|
||||||
|| (application_state_handler->on_ring
|
|
||||||
&& application_state_handler->on_ring(session) == SWITCH_STATUS_SUCCESS
|
|
||||||
&& midstate == switch_channel_get_state(session->channel))) {
|
|
||||||
proceed++;
|
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
proceed = 0;
|
|
||||||
break;
|
break;
|
||||||
}
|
case CS_RESET: /* Reset */
|
||||||
}
|
STATE_MACRO(reset, "RESET");
|
||||||
index = 0;
|
|
||||||
while (proceed && (application_state_handler = switch_core_get_state_handler(index++)) != 0) {
|
|
||||||
if (!application_state_handler || !application_state_handler->on_ring ||
|
|
||||||
(application_state_handler->on_ring &&
|
|
||||||
application_state_handler->on_ring(session) == SWITCH_STATUS_SUCCESS
|
|
||||||
&& midstate == switch_channel_get_state(session->channel))) {
|
|
||||||
proceed++;
|
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
proceed = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (proceed) {
|
|
||||||
switch_core_standard_on_ring(session);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case CS_RESET: /* Look for a dialplan and find something to do */
|
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) State RESET\n", switch_channel_get_name(session->channel));
|
|
||||||
if (!driver_state_handler->on_reset
|
|
||||||
|| (driver_state_handler->on_reset && driver_state_handler->on_reset(session) == SWITCH_STATUS_SUCCESS
|
|
||||||
&& midstate == switch_channel_get_state(session->channel))) {
|
|
||||||
while ((application_state_handler = switch_channel_get_state_handler(session->channel, index++)) != 0) {
|
|
||||||
if (!application_state_handler || !application_state_handler->on_reset
|
|
||||||
|| (application_state_handler->on_reset
|
|
||||||
&& application_state_handler->on_reset(session) == SWITCH_STATUS_SUCCESS
|
|
||||||
&& midstate == switch_channel_get_state(session->channel))) {
|
|
||||||
proceed++;
|
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
proceed = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
index = 0;
|
|
||||||
while (proceed && (application_state_handler = switch_core_get_state_handler(index++)) != 0) {
|
|
||||||
if (!application_state_handler || !application_state_handler->on_reset ||
|
|
||||||
(application_state_handler->on_reset &&
|
|
||||||
application_state_handler->on_reset(session) == SWITCH_STATUS_SUCCESS
|
|
||||||
&& midstate == switch_channel_get_state(session->channel))) {
|
|
||||||
proceed++;
|
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
proceed = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (proceed) {
|
|
||||||
switch_core_standard_on_reset(session);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case CS_EXECUTE: /* Execute an Operation */
|
case CS_EXECUTE: /* Execute an Operation */
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) State EXECUTE\n", switch_channel_get_name(session->channel));
|
STATE_MACRO(execute, "EXECUTE");
|
||||||
if (!driver_state_handler->on_execute
|
|
||||||
|| (driver_state_handler->on_execute
|
|
||||||
&& driver_state_handler->on_execute(session) == SWITCH_STATUS_SUCCESS && midstate == switch_channel_get_state(session->channel))) {
|
|
||||||
while ((application_state_handler = switch_channel_get_state_handler(session->channel, index++)) != 0) {
|
|
||||||
if (!application_state_handler || !application_state_handler->on_execute
|
|
||||||
|| (application_state_handler->on_execute
|
|
||||||
&& application_state_handler->on_execute(session) == SWITCH_STATUS_SUCCESS
|
|
||||||
&& midstate == switch_channel_get_state(session->channel))) {
|
|
||||||
proceed++;
|
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
proceed = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
index = 0;
|
|
||||||
while (proceed && (application_state_handler = switch_core_get_state_handler(index++)) != 0) {
|
|
||||||
if (!application_state_handler || !application_state_handler->on_execute ||
|
|
||||||
(application_state_handler->on_execute &&
|
|
||||||
application_state_handler->on_execute(session) == SWITCH_STATUS_SUCCESS &&
|
|
||||||
midstate == switch_channel_get_state(session->channel))) {
|
|
||||||
proceed++;
|
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
proceed = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (proceed) {
|
|
||||||
switch_core_standard_on_execute(session);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case CS_LOOPBACK: /* loop all data back to source */
|
case CS_LOOPBACK: /* loop all data back to source */
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) State LOOPBACK\n", switch_channel_get_name(session->channel));
|
STATE_MACRO(loopback, "LOOPBACK");
|
||||||
if (!driver_state_handler->on_loopback
|
|
||||||
|| (driver_state_handler->on_loopback
|
|
||||||
&& driver_state_handler->on_loopback(session) == SWITCH_STATUS_SUCCESS
|
|
||||||
&& midstate == switch_channel_get_state(session->channel))) {
|
|
||||||
while ((application_state_handler = switch_channel_get_state_handler(session->channel, index++)) != 0) {
|
|
||||||
if (!application_state_handler || !application_state_handler->on_loopback
|
|
||||||
|| (application_state_handler->on_loopback
|
|
||||||
&& application_state_handler->on_loopback(session) == SWITCH_STATUS_SUCCESS
|
|
||||||
&& midstate == switch_channel_get_state(session->channel))) {
|
|
||||||
proceed++;
|
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
proceed = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
index = 0;
|
|
||||||
while (proceed && (application_state_handler = switch_core_get_state_handler(index++)) != 0) {
|
|
||||||
if (!application_state_handler || !application_state_handler->on_loopback ||
|
|
||||||
(application_state_handler->on_loopback &&
|
|
||||||
application_state_handler->on_loopback(session) == SWITCH_STATUS_SUCCESS &&
|
|
||||||
midstate == switch_channel_get_state(session->channel))) {
|
|
||||||
proceed++;
|
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
proceed = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (proceed) {
|
|
||||||
switch_core_standard_on_loopback(session);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case CS_TRANSMIT: /* send/recieve data to/from another channel */
|
case CS_TRANSMIT: /* send/recieve data to/from another channel */
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) State TRANSMIT\n", switch_channel_get_name(session->channel));
|
STATE_MACRO(transmit, "TRANSMIT");
|
||||||
if (!driver_state_handler->on_transmit
|
|
||||||
|| (driver_state_handler->on_transmit
|
|
||||||
&& driver_state_handler->on_transmit(session) == SWITCH_STATUS_SUCCESS
|
|
||||||
&& midstate == switch_channel_get_state(session->channel))) {
|
|
||||||
|
|
||||||
while ((application_state_handler = switch_channel_get_state_handler(session->channel, index++)) != 0) {
|
|
||||||
if (!application_state_handler || !application_state_handler->on_transmit
|
|
||||||
|| (application_state_handler->on_transmit
|
|
||||||
&& application_state_handler->on_transmit(session) == SWITCH_STATUS_SUCCESS
|
|
||||||
&& midstate == switch_channel_get_state(session->channel))) {
|
|
||||||
proceed++;
|
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
proceed = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
index = 0;
|
|
||||||
while (proceed && (application_state_handler = switch_core_get_state_handler(index++)) != 0) {
|
|
||||||
if (!application_state_handler || !application_state_handler->on_transmit ||
|
|
||||||
(application_state_handler->on_transmit &&
|
|
||||||
application_state_handler->on_transmit(session) == SWITCH_STATUS_SUCCESS &&
|
|
||||||
midstate == switch_channel_get_state(session->channel))) {
|
|
||||||
proceed++;
|
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
proceed = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (proceed) {
|
|
||||||
switch_core_standard_on_transmit(session);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case CS_HOLD: /* wait in limbo */
|
case CS_HOLD: /* wait in limbo */
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) State HOLD\n", switch_channel_get_name(session->channel));
|
STATE_MACRO(hold, "HOLD");
|
||||||
if (!driver_state_handler->on_hold
|
|
||||||
|| (driver_state_handler->on_hold && driver_state_handler->on_hold(session) == SWITCH_STATUS_SUCCESS
|
|
||||||
&& midstate == switch_channel_get_state(session->channel))) {
|
|
||||||
|
|
||||||
while ((application_state_handler = switch_channel_get_state_handler(session->channel, index++)) != 0) {
|
|
||||||
if (!application_state_handler || !application_state_handler->on_hold
|
|
||||||
|| (application_state_handler->on_hold
|
|
||||||
&& application_state_handler->on_hold(session) == SWITCH_STATUS_SUCCESS
|
|
||||||
&& midstate == switch_channel_get_state(session->channel))) {
|
|
||||||
proceed++;
|
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
proceed = 0;
|
|
||||||
break;
|
break;
|
||||||
}
|
case CS_HIBERNATE: /* sleep */
|
||||||
}
|
STATE_MACRO(hibernate, "HIBERNATE");
|
||||||
index = 0;
|
|
||||||
while (proceed && (application_state_handler = switch_core_get_state_handler(index++)) != 0) {
|
|
||||||
if (!application_state_handler || !application_state_handler->on_hold ||
|
|
||||||
(application_state_handler->on_hold &&
|
|
||||||
application_state_handler->on_hold(session) == SWITCH_STATUS_SUCCESS
|
|
||||||
&& midstate == switch_channel_get_state(session->channel))) {
|
|
||||||
proceed++;
|
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
proceed = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (proceed) {
|
|
||||||
switch_core_standard_on_hold(session);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case CS_HIBERNATE: /* wait in limbo */
|
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) State HIBERNATE\n", switch_channel_get_name(session->channel));
|
|
||||||
if (!driver_state_handler->on_hibernate
|
|
||||||
|| (driver_state_handler->on_hibernate
|
|
||||||
&& driver_state_handler->on_hibernate(session) == SWITCH_STATUS_SUCCESS
|
|
||||||
&& midstate == switch_channel_get_state(session->channel))) {
|
|
||||||
|
|
||||||
while ((application_state_handler = switch_channel_get_state_handler(session->channel, index++)) != 0) {
|
|
||||||
if (!application_state_handler || !application_state_handler->on_hibernate
|
|
||||||
|| (application_state_handler->on_hibernate
|
|
||||||
&& application_state_handler->on_hibernate(session) == SWITCH_STATUS_SUCCESS
|
|
||||||
&& midstate == switch_channel_get_state(session->channel))) {
|
|
||||||
proceed++;
|
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
proceed = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
index = 0;
|
|
||||||
while (proceed && (application_state_handler = switch_core_get_state_handler(index++)) != 0) {
|
|
||||||
if (!application_state_handler || !application_state_handler->on_hibernate ||
|
|
||||||
(application_state_handler->on_hibernate &&
|
|
||||||
application_state_handler->on_hibernate(session) == SWITCH_STATUS_SUCCESS &&
|
|
||||||
midstate == switch_channel_get_state(session->channel))) {
|
|
||||||
proceed++;
|
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
proceed = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (proceed) {
|
|
||||||
switch_core_standard_on_hibernate(session);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -366,8 +366,14 @@ SWITCH_DECLARE(switch_status_t) switch_event_reserve_subclass_detailed(char *own
|
|||||||
SWITCH_DECLARE(void) switch_core_memory_reclaim_events(void)
|
SWITCH_DECLARE(void) switch_core_memory_reclaim_events(void)
|
||||||
{
|
{
|
||||||
void *pop;
|
void *pop;
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Returning %d recycled event node(s) and %d recycled event header node(s)\n",
|
int size;
|
||||||
switch_queue_size(EVENT_RECYCLE_QUEUE),switch_queue_size(EVENT_HEADER_RECYCLE_QUEUE));
|
size = switch_queue_size(EVENT_RECYCLE_QUEUE);
|
||||||
|
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Returning %d recycled event(s) %d bytes\n", size, (int) sizeof(switch_event_t) * size);
|
||||||
|
size = switch_queue_size(EVENT_HEADER_RECYCLE_QUEUE);
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Returning %d recycled event header(s) %d bytes\n",
|
||||||
|
size, (int) sizeof(switch_event_header_t) * size);
|
||||||
|
|
||||||
|
|
||||||
while (switch_queue_trypop(EVENT_HEADER_RECYCLE_QUEUE, &pop) == SWITCH_STATUS_SUCCESS) {
|
while (switch_queue_trypop(EVENT_HEADER_RECYCLE_QUEUE, &pop) == SWITCH_STATUS_SUCCESS) {
|
||||||
free(pop);
|
free(pop);
|
||||||
|
@ -282,7 +282,8 @@ SWITCH_DECLARE(switch_status_t) switch_log_init(switch_memory_pool_t *pool)
|
|||||||
SWITCH_DECLARE(void) switch_core_memory_reclaim_logger(void)
|
SWITCH_DECLARE(void) switch_core_memory_reclaim_logger(void)
|
||||||
{
|
{
|
||||||
void *pop;
|
void *pop;
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Returning %d recycled log node(s)\n", switch_queue_size(LOG_RECYCLE_QUEUE));
|
int size = switch_queue_size(LOG_RECYCLE_QUEUE);
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Returning %d recycled log node(s) %d bytes\n", size, (int)sizeof(switch_log_node_t) * size);
|
||||||
while (switch_queue_trypop(LOG_RECYCLE_QUEUE, &pop) == SWITCH_STATUS_SUCCESS) {
|
while (switch_queue_trypop(LOG_RECYCLE_QUEUE, &pop) == SWITCH_STATUS_SUCCESS) {
|
||||||
free(pop);
|
free(pop);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user