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
7563b6ea
Commit
7563b6ea
authored
12 years ago
by
Konstantin Shulgin
Browse files
Options
Downloads
Patches
Plain Diff
bug899343: review fixes.
parent
0d3e60bf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
include/iproto.h
+2
-2
2 additions, 2 deletions
include/iproto.h
src/iproto.m
+6
-3
6 additions, 3 deletions
src/iproto.m
test/box/iproto.result
+3
-10
3 additions, 10 deletions
test/box/iproto.result
test/box/iproto.test
+1
-1
1 addition, 1 deletion
test/box/iproto.test
with
12 additions
and
16 deletions
include/iproto.h
+
2
−
2
View file @
7563b6ea
...
...
@@ -28,8 +28,8 @@
#include
<tbuf.h>
/* for struct tbuf */
enum
{
/** Maximal iproto package length (2GiB) */
IPROTO_LEN_MAX
=
2147483648
,
/** Maximal iproto package
body
length (2GiB) */
IPROTO_
BODY_
LEN_MAX
=
2147483648
,
};
/*
...
...
This diff is collapsed.
Click to expand it.
src/iproto.m
+
6
−
3
View file @
7563b6ea
...
...
@@ -132,9 +132,12 @@ static void iproto_reply(iproto_callback callback, struct tbuf *request)
static void
iproto_validate_header(struct iproto_header *header)
{
if (header->len > IPROTO_LEN_MAX) {
/* the package has invalid length, close connection */
say_error("Invalid iproto package length: %llu",
if (header->len > IPROTO_BODY_LEN_MAX) {
/*
* The package is too big, just close connection for now to
* avoid DoS.
*/
say_error("received package is too big: %llu",
(unsigned long long)header->len);
tnt_raise(FiberCancelException);
}
...
...
This diff is collapsed.
Click to expand it.
test/box/iproto.result
+
3
−
10
View file @
7563b6ea
...
...
@@ -9,13 +9,6 @@
# sending the package with invalid length
12
# checking what is server alive
show stat
---
statistics:
REPLACE: { rps: 0 , total: 0 }
SELECT: { rps: 0 , total: 0 }
UPDATE: { rps: 0 , total: 0 }
DELETE_1_3: { rps: 0 , total: 0 }
DELETE: { rps: 0 , total: 0 }
CALL: { rps: 0 , total: 0 }
...
ping
ok
---
This diff is collapsed.
Click to expand it.
test/box/iproto.test
+
1
−
1
View file @
7563b6ea
...
...
@@ -21,7 +21,7 @@ print "# sending the package with invalid length"
inval_request
=
struct
.
pack
(
'<LLL'
,
17
,
4294967290
,
1
)
print
s
.
send
(
inval_request
)
print
"# checking what is server alive"
exec
admin
"show stat
"
exec
sql
"ping
"
# closing connection
s
.
close
()
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