Skip to content

Commit

Permalink
Avoid C++ unused goto symbol warning when liburing is not supported (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ibc committed Dec 4, 2023
1 parent ab46e36 commit b578d42
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 5 additions & 4 deletions worker/src/handles/TcpConnectionHandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,17 +265,18 @@ void TcpConnectionHandle::Write(

return;
}
#endif

write_libuv:
#endif

// First try uv_try_write(). In case it can not directly write all the given
// data then build a uv_req_t and use uv_write().

const size_t totalLen = len1 + len2;
uv_buf_t buffers[2];
int written{ 0 };
int err;

// First try uv_try_write(). In case it can not directly write all the given
// data then build a uv_req_t and use uv_write().

buffers[0] = uv_buf_init(reinterpret_cast<char*>(const_cast<uint8_t*>(data1)), len1);
buffers[1] = uv_buf_init(reinterpret_cast<char*>(const_cast<uint8_t*>(data2)), len2);
written = uv_try_write(reinterpret_cast<uv_stream_t*>(this->uvHandle), buffers, 2);
Expand Down
3 changes: 2 additions & 1 deletion worker/src/handles/UdpSocketHandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,10 @@ void UdpSocketHandle::Send(

return;
}
#endif

send_libuv:
#endif

// First try uv_udp_try_send(). In case it can not directly send the datagram
// then build a uv_req_t and use uv_udp_send().

Expand Down

0 comments on commit b578d42

Please sign in to comment.