Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exclusive_publication by not cloning BufferClaim #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/exclusive_publication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ impl ExclusivePublication {
* @see BufferClaim::commit
* @see BufferClaim::abort
*/
pub fn try_claim(&mut self, length: Index, mut buffer_claim: BufferClaim) -> Result<i64, AeronError> {
pub fn try_claim(&mut self, length: Index, buffer_claim: &mut BufferClaim) -> Result<i64, AeronError> {
self.check_payload_length(length)?;

if !self.is_closed() {
Expand All @@ -500,7 +500,7 @@ impl ExclusivePublication {

if position < limit {
let resulting_offset =
term_appender.claim(self.term_id, self.term_offset, &self.header_writer, length, &mut buffer_claim);
term_appender.claim(self.term_id, self.term_offset, &self.header_writer, length, buffer_claim);
Ok(self.new_position(resulting_offset)?)
} else {
Err(self.back_pressure_status(position, length))
Expand Down