Skip to content

Allow setting sockstreambuf buffer size and max putback#3154

Open
kSkip wants to merge 2 commits into
davisking:masterfrom
kSkip:sockstreambuf-ctor-args
Open

Allow setting sockstreambuf buffer size and max putback#3154
kSkip wants to merge 2 commits into
davisking:masterfrom
kSkip:sockstreambuf-ctor-args

Conversation

@kSkip

@kSkip kSkip commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

I would like to use the sockstreambuf with a larger buffer size, and think it would be nice to adjust the max put back as well. In addition, I also changed the buffer pointers to unique_ptr. I figured that was just pre-C++11 code.

Comment on lines -101 to +106
setp(out_buffer, out_buffer + (out_buffer_size-1));
setg(in_buffer+max_putback,
in_buffer+max_putback,
in_buffer+max_putback);
setp(out_buffer.get(), out_buffer.get() + (out_buffer_size-1));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For here, should this be out_buffer + out_buffer_size? Because epptr is defined as "one past the end of the put area". If I understand this correctly, the effective buffer size will be 1 char smaller if we use out_buffer_size-1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant