提交 4e91bdef authored 作者: Nazar Mokrynskyi's avatar Nazar Mokrynskyi

Tiny refactoring

上级 ab3c4ae3
...@@ -338,10 +338,10 @@ impl Channel { ...@@ -338,10 +338,10 @@ impl Channel {
outgoing_message_buffer outgoing_message_buffer
.messages .messages
.push_back(Arc::clone(&message)); .push_back(Arc::clone(&message));
if let Some(handle) = &outgoing_message_buffer.handle { if let Some(handle) = outgoing_message_buffer.handle {
unsafe { unsafe {
// Notify worker that there is something to read // Notify worker that there is something to read
let ret = mediasoup_sys::uv_async_send(*handle); let ret = mediasoup_sys::uv_async_send(handle);
if ret != 0 { if ret != 0 {
error!("uv_async_send call failed with code {}", ret); error!("uv_async_send call failed with code {}", ret);
return Err(RequestError::ChannelClosed); return Err(RequestError::ChannelClosed);
......
...@@ -298,10 +298,10 @@ impl PayloadChannel { ...@@ -298,10 +298,10 @@ impl PayloadChannel {
outgoing_message_buffer outgoing_message_buffer
.messages .messages
.push_back(OutgoingMessage::Request(Arc::clone(&message_with_payload))); .push_back(OutgoingMessage::Request(Arc::clone(&message_with_payload)));
if let Some(handle) = &outgoing_message_buffer.handle { if let Some(handle) = outgoing_message_buffer.handle {
unsafe { unsafe {
// Notify worker that there is something to read // Notify worker that there is something to read
let ret = mediasoup_sys::uv_async_send(*handle); let ret = mediasoup_sys::uv_async_send(handle);
if ret != 0 { if ret != 0 {
error!("uv_async_send call failed with code {}", ret); error!("uv_async_send call failed with code {}", ret);
return Err(RequestError::ChannelClosed); return Err(RequestError::ChannelClosed);
...@@ -362,10 +362,10 @@ impl PayloadChannel { ...@@ -362,10 +362,10 @@ impl PayloadChannel {
outgoing_message_buffer outgoing_message_buffer
.messages .messages
.push_back(OutgoingMessage::Notification { message, payload }); .push_back(OutgoingMessage::Notification { message, payload });
if let Some(handle) = &outgoing_message_buffer.handle { if let Some(handle) = outgoing_message_buffer.handle {
unsafe { unsafe {
// Notify worker that there is something to read // Notify worker that there is something to read
let ret = mediasoup_sys::uv_async_send(*handle); let ret = mediasoup_sys::uv_async_send(handle);
if ret != 0 { if ret != 0 {
error!("uv_async_send call failed with code {}", ret); error!("uv_async_send call failed with code {}", ret);
return Err(NotificationError::ChannelClosed); return Err(NotificationError::ChannelClosed);
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论