Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
0d675fd5
Commit
0d675fd5
authored
8 years ago
by
Konstantin Osipov
Browse files
Options
Downloads
Patches
Plain Diff
iproto: fix the bug with ever growing output buffer
* don't recycle input buffer if this leads to growth of the output buffer
parent
30d9171a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/iproto.cc
+15
-2
15 additions, 2 deletions
src/iproto.cc
with
15 additions
and
2 deletions
src/iproto.cc
+
15
−
2
View file @
0d675fd5
...
@@ -442,8 +442,21 @@ iproto_session_input_iobuf(struct iproto_session *session)
...
@@ -442,8 +442,21 @@ iproto_session_input_iobuf(struct iproto_session *session)
if
(
ibuf_unused
(
&
oldbuf
->
in
)
>=
to_read
)
if
(
ibuf_unused
(
&
oldbuf
->
in
)
>=
to_read
)
return
oldbuf
;
return
oldbuf
;
/** All requests are processed, reuse the buffer. */
/**
if
(
ibuf_size
(
&
oldbuf
->
in
)
==
session
->
parse_size
)
{
* Reuse the buffer if:
* - all requests are processed (in only has unparsed
* content, and out is empty, so we will not bloat
* output by reusing input
* - we received a large packet, so we need to
* extend input buffer size to store a single large
* packet. In this case we need to realloc the input
* buffer, simply falling through to the subsequent
* branches will not make the buffer larger.
*/
if
(
ibuf_size
(
&
oldbuf
->
in
)
==
session
->
parse_size
&&
(
ibuf_pos
(
&
oldbuf
->
in
)
==
session
->
parse_size
||
obuf_size
(
&
oldbuf
->
out
)
==
0
))
{
ibuf_reserve
(
&
oldbuf
->
in
,
to_read
);
ibuf_reserve
(
&
oldbuf
->
in
,
to_read
);
return
oldbuf
;
return
oldbuf
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment