提交 6f89e253 authored 作者: William King's avatar William King

Moving all rtmp specific logging to use the rtmp uuid rather than the session uuid.

上级 fa6d4657
......@@ -118,7 +118,7 @@ RTMP_INVOKE_FUNCTION(rtmp_i_connect)
amf0_null_new(),
amf0_str(rsession->uuid), NULL);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Sent connect reply\n");
switch_log_printf(SWITCH_CHANNEL_UUID_LOG(rsession->uuid), SWITCH_LOG_NOTICE, "Sent connect reply\n");
return SWITCH_STATUS_SUCCESS;
}
......@@ -133,7 +133,7 @@ RTMP_INVOKE_FUNCTION(rtmp_i_createStream)
amf0_number_new(rsession->next_streamid),
NULL);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Replied to createStream (%u)\n", rsession->next_streamid);
switch_log_printf(SWITCH_CHANNEL_UUID_LOG(rsession->uuid), SWITCH_LOG_INFO, "Replied to createStream (%u)\n", rsession->next_streamid);
rsession->next_streamid++;
......@@ -156,7 +156,7 @@ RTMP_INVOKE_FUNCTION(rtmp_i_receiveaudio)
switch_clear_flag(rsession, SFLAG_AUDIO);
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%sending audio\n", enabled ? "S" : "Not s");
switch_log_printf(SWITCH_CHANNEL_UUID_LOG(rsession->uuid), SWITCH_LOG_INFO, "%sending audio\n", enabled ? "S" : "Not s");
return SWITCH_STATUS_SUCCESS;
}
......@@ -174,7 +174,7 @@ RTMP_INVOKE_FUNCTION(rtmp_i_receivevideo)
switch_clear_flag(rsession, SFLAG_VIDEO);
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%sending video\n", enabled ? "S" : "Not s");
switch_log_printf(SWITCH_CHANNEL_UUID_LOG(rsession->uuid), SWITCH_LOG_INFO, "%sending video\n", enabled ? "S" : "Not s");
return SWITCH_STATUS_SUCCESS;
}
......@@ -185,7 +185,7 @@ RTMP_INVOKE_FUNCTION(rtmp_i_play)
amf0_data *obj = amf0_object_new();
amf0_data *object = amf0_object_new();
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Got play for %s on stream %d\n", switch_str_nil(amf0_get_string(argv[1])),
switch_log_printf(SWITCH_CHANNEL_UUID_LOG(rsession->uuid), SWITCH_LOG_DEBUG, "Got play for %s on stream %d\n", switch_str_nil(amf0_get_string(argv[1])),
state->stream_id);
/* Set outgoing chunk size to 1024 bytes */
......@@ -271,7 +271,7 @@ RTMP_INVOKE_FUNCTION(rtmp_i_publish)
NULL);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Got publish on stream %u.\n", state->stream_id);
switch_log_printf(SWITCH_CHANNEL_UUID_LOG(rsession->uuid), SWITCH_LOG_INFO, "Got publish on stream %u.\n", state->stream_id);
return SWITCH_STATUS_SUCCESS;
}
......@@ -783,7 +783,7 @@ RTMP_INVOKE_FUNCTION(rtmp_i_sendevent)
uuid = amf0_get_string(argv[1]);
obj = argv[2];
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Bad argument for sendevent");
switch_log_printf(SWITCH_CHANNEL_UUID_LOG(rsession->uuid), SWITCH_LOG_ERROR, "Bad argument for sendevent");
return SWITCH_STATUS_FALSE;
}
......
......@@ -70,7 +70,7 @@ static void rtmp_tcp_alter_pollfd(rtmp_session_t *rsession, switch_bool_t pollou
if (pollout) {
io_pvt->pollfd->reqevents |= SWITCH_POLLOUT;
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Pollout: %s\n",
switch_log_printf(SWITCH_CHANNEL_UUID_LOG(rsession->uuid), SWITCH_LOG_NOTICE, "Pollout: %s\n",
pollout ? "true" : "false");
switch_pollset_add(io->pollset, io_pvt->pollfd);
......@@ -153,7 +153,7 @@ static switch_status_t rtmp_tcp_write(rtmp_session_t *rsession, const unsigned c
}
/* We didnt send it all... add it to the sendq*/
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%"SWITCH_SIZE_T_FMT" bytes added to sendq.\n", (orig_len - *len));
switch_log_printf(SWITCH_CHANNEL_UUID_LOG(rsession->uuid), SWITCH_LOG_DEBUG, "%"SWITCH_SIZE_T_FMT" bytes added to sendq.\n", (orig_len - *len));
switch_buffer_write(io_pvt->sendq, (buf + *len), orig_len - *len);
......@@ -217,7 +217,7 @@ void *SWITCH_THREAD_FUNC rtmp_io_tcp_thread(switch_thread_t *thread, void *obj)
return NULL;
}
} else {
rtmp_session_t *newsession;
rtmp_session_t *rsession;
if (switch_socket_opt_set(newsocket, SWITCH_SO_NONBLOCK, TRUE)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Couldn't set socket as non-blocking\n");
......@@ -227,7 +227,7 @@ void *SWITCH_THREAD_FUNC rtmp_io_tcp_thread(switch_thread_t *thread, void *obj)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Couldn't disable Nagle.\n");
}
if (rtmp_session_request(io->base.profile, &newsession) != SWITCH_STATUS_SUCCESS) {
if (rtmp_session_request(io->base.profile, &rsession) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "RTMP session request failed\n");
switch_socket_close(newsocket);
} else {
......@@ -235,20 +235,20 @@ void *SWITCH_THREAD_FUNC rtmp_io_tcp_thread(switch_thread_t *thread, void *obj)
char ipbuf[200];
/* Create out private data and attach it to the rtmp session structure */
rtmp_tcp_io_private_t *pvt = switch_core_alloc(newsession->pool, sizeof(*pvt));
newsession->io_private = pvt;
rtmp_tcp_io_private_t *pvt = switch_core_alloc(rsession->pool, sizeof(*pvt));
rsession->io_private = pvt;
pvt->socket = newsocket;
switch_socket_create_pollfd(&pvt->pollfd, newsocket, SWITCH_POLLIN | SWITCH_POLLERR, newsession, newsession->pool);
switch_socket_create_pollfd(&pvt->pollfd, newsocket, SWITCH_POLLIN | SWITCH_POLLERR, rsession, rsession->pool);
switch_pollset_add(io->pollset, pvt->pollfd);
switch_buffer_create_dynamic(&pvt->sendq, 512, 1024, 0);
/* Get the remote address/port info */
switch_socket_addr_get(&addr, SWITCH_TRUE, newsocket);
switch_get_addr(ipbuf, sizeof(ipbuf), addr);
newsession->remote_address = switch_core_strdup(newsession->pool, ipbuf);
newsession->remote_port = switch_sockaddr_get_port(addr);
switch_log_printf(SWITCH_CHANNEL_UUID_LOG(newsession->uuid), SWITCH_LOG_INFO, "Rtmp connection from %s:%i\n",
newsession->remote_address, newsession->remote_port);
rsession->remote_address = switch_core_strdup(rsession->pool, ipbuf);
rsession->remote_port = switch_sockaddr_get_port(addr);
switch_log_printf(SWITCH_CHANNEL_UUID_LOG(rsession->uuid), SWITCH_LOG_INFO, "Rtmp connection from %s:%i\n",
rsession->remote_address, rsession->remote_port);
}
}
} else {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论