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

XrdTpc: Buffer starting at the right offset. #1409

Merged
merged 1 commit into from
Feb 23, 2021
Merged
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/XrdTpc/XrdTpcStream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Stream::Write(off_t offset, const char *buf, size_t size, bool force)
avail_count ++;
}
else if (bytes_accepted != size && size) {
size_t new_accept = (*entry_iter)->Accept(offset + bytes_accepted, buf, size - bytes_accepted);
size_t new_accept = (*entry_iter)->Accept(offset + bytes_accepted, buf + bytes_accepted, size - bytes_accepted);
// Partial accept; buffer should be writable which means we should free it up
// for next iteration
if (new_accept && new_accept != size - bytes_accepted) {
Expand All @@ -143,7 +143,7 @@ Stream::Write(off_t offset, const char *buf, size_t size, bool force)
m_error_buf = "No empty buffers available to place unordered data.";
return SFS_ERROR;
}
if (avail_entry->Accept(offset + bytes_accepted, buf, size - bytes_accepted) != size - bytes_accepted) { // Empty buffer cannot accept?!?
if (avail_entry->Accept(offset + bytes_accepted, buf + bytes_accepted, size - bytes_accepted) != size - bytes_accepted) { // Empty buffer cannot accept?!?
m_error_buf = "Empty re-ordering buffer was unable to to accept data; internal logic error.";
return SFS_ERROR;
}
Expand Down