mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-16 00:41:41 +00:00
vroom
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6022 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
0ed7b160b1
commit
d125f8a74b
@ -282,7 +282,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_destroy_memory_pool(switch_m
|
|||||||
printf("Free Pool %s %s:%d\n", file, func, line);
|
printf("Free Pool %s %s:%d\n", file, func, line);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (switch_queue_trypush(memory_manager.pool_queue, *pool) != SWITCH_STATUS_SUCCESS) {
|
if (switch_queue_push(memory_manager.pool_queue, *pool) != SWITCH_STATUS_SUCCESS) {
|
||||||
apr_pool_destroy(*pool);
|
apr_pool_destroy(*pool);
|
||||||
}
|
}
|
||||||
*pool = NULL;
|
*pool = NULL;
|
||||||
|
@ -768,35 +768,27 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request(const switch
|
|||||||
if (pool && *pool) {
|
if (pool && *pool) {
|
||||||
usepool = *pool;
|
usepool = *pool;
|
||||||
*pool = NULL;
|
*pool = NULL;
|
||||||
} else if (switch_core_new_memory_pool(&usepool) != SWITCH_STATUS_SUCCESS) {
|
} else {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Could not allocate memory pool\n");
|
switch_core_new_memory_pool(&usepool);
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((session = switch_core_alloc(usepool, sizeof(switch_core_session_t))) == 0) {
|
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Could not allocate session\n");
|
|
||||||
switch_core_destroy_memory_pool(&usepool);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (switch_channel_alloc(&session->channel, usepool) != SWITCH_STATUS_SUCCESS) {
|
session = switch_core_alloc(usepool, sizeof(*session));
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not allocate channel structure\n");
|
session->pool = usepool;
|
||||||
switch_core_destroy_memory_pool(&usepool);
|
|
||||||
return NULL;
|
if (switch_channel_alloc(&session->channel, session->pool) != SWITCH_STATUS_SUCCESS) {
|
||||||
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
switch_channel_init(session->channel, session, CS_NEW, 0);
|
switch_channel_init(session->channel, session, CS_NEW, 0);
|
||||||
|
|
||||||
|
|
||||||
/* The session *IS* the pool you may not alter it because you have no idea how
|
/* The session *IS* the pool you may not alter it because you have no idea how
|
||||||
its all private it will be passed to the thread run function */
|
its all private it will be passed to the thread run function */
|
||||||
|
|
||||||
switch_uuid_get(&uuid);
|
switch_uuid_get(&uuid);
|
||||||
switch_uuid_format(session->uuid_str, &uuid);
|
switch_uuid_format(session->uuid_str, &uuid);
|
||||||
|
|
||||||
session->pool = usepool;
|
|
||||||
session->endpoint_interface = endpoint_interface;
|
session->endpoint_interface = endpoint_interface;
|
||||||
|
|
||||||
session->raw_write_frame.data = session->raw_write_buf;
|
session->raw_write_frame.data = session->raw_write_buf;
|
||||||
session->raw_write_frame.buflen = sizeof(session->raw_write_buf);
|
session->raw_write_frame.buflen = sizeof(session->raw_write_buf);
|
||||||
session->raw_read_frame.data = session->raw_read_buf;
|
session->raw_read_frame.data = session->raw_read_buf;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user