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
53b61a8c
Commit
53b61a8c
authored
10 years ago
by
Konstantin Osipov
Browse files
Options
Downloads
Patches
Plain Diff
net.box: optimize write buffering
parent
7f8a9a70
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/lua/net_box.lua
+13
-8
13 additions, 8 deletions
src/lua/net_box.lua
with
13 additions
and
8 deletions
src/lua/net_box.lua
+
13
−
8
View file @
53b61a8c
...
@@ -592,7 +592,7 @@ local remote_methods = {
...
@@ -592,7 +592,7 @@ local remote_methods = {
self
:
_switch_state
(
'error'
)
self
:
_switch_state
(
'error'
)
self
:
_error_waiters
(
emsg
)
self
:
_error_waiters
(
emsg
)
self
.
rbuf
=
''
self
.
rbuf
=
''
self
.
wbuf
=
''
self
.
wbuf
=
{}
self
.
handshake
=
''
self
.
handshake
=
''
end
,
end
,
...
@@ -791,7 +791,7 @@ local remote_methods = {
...
@@ -791,7 +791,7 @@ local remote_methods = {
elseif
string.len
(
self
.
handshake
)
~=
128
then
elseif
string.len
(
self
.
handshake
)
~=
128
then
self
:
_fatal
(
"Can't read handshake"
)
self
:
_fatal
(
"Can't read handshake"
)
else
else
self
.
wbuf
=
''
self
.
wbuf
=
{}
self
.
rbuf
=
''
self
.
rbuf
=
''
if
string.match
(
self
.
handshake
,
'^Tarantool .*console'
)
then
if
string.match
(
self
.
handshake
,
'^Tarantool .*console'
)
then
...
@@ -985,7 +985,7 @@ local remote_methods = {
...
@@ -985,7 +985,7 @@ local remote_methods = {
break
break
end
end
if
string.len
(
self
.
wbuf
)
==
0
then
if
self
.
wbuf
[
1
]
==
nil
then
local
wstate
=
self
.
_to_rstate
[
self
.
state
]
local
wstate
=
self
.
_to_rstate
[
self
.
state
]
if
wstate
~=
nil
then
if
wstate
~=
nil
then
...
@@ -998,12 +998,17 @@ local remote_methods = {
...
@@ -998,12 +998,17 @@ local remote_methods = {
break
break
end
end
if
self
:
_is_rw_state
()
then
if
self
:
_is_rw_state
()
then
if
#
self
.
wbuf
>
0
then
if
self
.
wbuf
[
1
]
~=
nil
then
local
written
=
self
.
s
:
syswrite
(
self
.
wbuf
)
local
s
=
table.concat
(
self
.
wbuf
)
self
.
wbuf
=
{}
local
written
=
self
.
s
:
syswrite
(
s
)
if
written
~=
nil
then
if
written
~=
nil
then
self
.
wbuf
=
string.sub
(
self
.
wbuf
,
if
written
~=
#
s
then
tonumber
(
1
+
written
))
table.insert
(
self
.
wbuf
,
string.sub
(
s
,
written
+
1
))
end
else
else
table.insert
(
self
.
wbuf
,
s
)
self
:
_fatal
(
errno
.
strerror
(
errno
()))
self
:
_fatal
(
errno
.
strerror
(
errno
()))
end
end
end
end
...
@@ -1062,7 +1067,7 @@ local remote_methods = {
...
@@ -1062,7 +1067,7 @@ local remote_methods = {
self
.
timeouts
[
fid
]
=
TIMEOUT_INFINITY
self
.
timeouts
[
fid
]
=
TIMEOUT_INFINITY
end
end
self
.
wbuf
=
self
.
wbuf
..
request
table.insert
(
self
.
wbuf
,
request
)
local
wstate
=
self
.
_to_wstate
[
self
.
state
]
local
wstate
=
self
.
_to_wstate
[
self
.
state
]
if
wstate
~=
nil
then
if
wstate
~=
nil
then
...
...
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