[api] Use buf_start directly in noise write_protobuf_packet, add flow comment

This commit is contained in:
J. Nick Koston
2026-03-29 13:42:57 -10:00
parent 6ff0d33ca4
commit b4de015706
2 changed files with 3 additions and 1 deletions
@@ -142,6 +142,7 @@ APIError APIFrameHelper::write_raw_iov_(const struct iovec *iov, int iovcnt, uin
(iovcnt == 1) ? this->socket_->write(iov[0].iov_base, iov[0].iov_len) : this->socket_->writev(iov, iovcnt);
if (sent == static_cast<ssize_t>(total_write_len))
return APIError::OK;
// Partial write or -1: fall through to error check / enqueue below
}
}
if (sent == -1) {
@@ -504,7 +504,8 @@ APIError APINoiseFrameHelper::write_protobuf_packet(uint8_t type, ProtoWriteBuff
APIError aerr = this->encrypt_noise_message_(buf_start, msg, iov);
if (aerr != APIError::OK)
return aerr;
return this->write_raw_fast_buf_(iov.iov_base, static_cast<uint16_t>(iov.iov_len));
// buf_start and iov.iov_base point to the same location
return this->write_raw_fast_buf_(buf_start, static_cast<uint16_t>(iov.iov_len));
}
APIError APINoiseFrameHelper::write_protobuf_messages(ProtoWriteBuffer buffer, std::span<const MessageInfo> messages) {