Skip to content

Commit

Permalink
fix stream while max_buf_size < 0 (apache#2360)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenbay authored Sep 21, 2023
1 parent 0ef35f3 commit 09f0916
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/brpc/stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ int Stream::Create(const StreamOptions &options,
s->_connected = false;
s->_options = options;
s->_closed = false;
s->_cur_buf_size = options.max_buf_size;
s->_cur_buf_size = options.max_buf_size > 0 ? options.max_buf_size : 0;
if (options.max_buf_size > 0 && options.min_buf_size > options.max_buf_size) {
// set 0 if min_buf_size is invalid.
s->_options.min_buf_size = 0;
Expand Down

0 comments on commit 09f0916

Please sign in to comment.