| 871 | } |
| 872 | |
| 873 | Transport::BytesToSend V1Transport::GetBytesToSend(bool have_next_message) const noexcept |
| 874 | { |
| 875 | AssertLockNotHeld(m_send_mutex); |
| 876 | LOCK(m_send_mutex); |
| 877 | if (m_sending_header) { |
| 878 | return {std::span{m_header_to_send}.subspan(m_bytes_sent), |
| 879 | // We have more to send after the header if the message has payload, or if there |
| 880 | // is a next message after that. |
| 881 | have_next_message || !m_message_to_send.data.empty(), |
| 882 | m_message_to_send.m_type |
| 883 | }; |
| 884 | } else { |
| 885 | return {std::span{m_message_to_send.data}.subspan(m_bytes_sent), |
| 886 | // We only have more to send after this message's payload if there is another |
| 887 | // message. |
| 888 | have_next_message, |
| 889 | m_message_to_send.m_type |
| 890 | }; |
| 891 | } |
| 892 | } |
| 893 | |
| 894 | void V1Transport::MarkBytesSent(size_t bytes_sent) noexcept |
| 895 | { |