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
1a01fee5
Commit
1a01fee5
authored
12 years ago
by
Konstantin Osipov
Browse files
Options
Downloads
Patches
Plain Diff
Don't crash when trying to print a too long unsupported request.
parent
41ef4182
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
mod/box/box.m
+1
-1
1 addition, 1 deletion
mod/box/box.m
mod/box/request.h
+2
-0
2 additions, 0 deletions
mod/box/request.h
mod/box/request.m
+16
-8
16 additions, 8 deletions
mod/box/request.m
with
19 additions
and
9 deletions
mod/box/box.m
+
1
−
1
View file @
1a01fee5
...
...
@@ -98,7 +98,7 @@ box_process_rw(struct txn *txn, struct port *port,
stop
=
ev
_
now
()
;
if
(
stop
-
start
>
cfg
.
too
_
long
_
threshold
)
say
_
warn
(
"too long %s: %.3f sec"
,
request
s
_
strs
[
op
]
,
stop
-
start
)
;
request
_
name
(
op
)
,
stop
-
start
)
;
}
}
...
...
This diff is collapsed.
Click to expand it.
mod/box/request.h
+
2
−
0
View file @
1a01fee5
...
...
@@ -100,6 +100,8 @@ request_is_select(u32 type)
return
type
==
SELECT
||
type
==
CALL
;
}
const
char
*
request_name
(
u32
type
);
struct
request
{
u32
type
;
...
...
This diff is collapsed.
Click to expand it.
mod/box/request.m
+
16
−
8
View file @
1a01fee5
...
...
@@ -817,22 +817,30 @@ execute_delete(struct request *request, struct txn *txn, struct port *port)
* We must collect stats before execute.
* Check request type here for now.
*/
static
void
static
bool
request_check_type(u32 type)
{
if (type != REPLACE && type != SELECT &&
type != UPDATE && type != DELETE_1_3 &&
type != DELETE && type != CALL) {
return (type != REPLACE && type != SELECT &&
type != UPDATE && type != DELETE_1_3 &&
type != DELETE && type != CALL);
}
say_error("Unsupported request = %" PRIi32 "", type);
tnt_raise(IllegalParams, :"unsupported command code, "
"check the error log");
}
const char *
request_name(u32 type)
{
if (request_check_type(type))
return "unsupported";
return requests_strs[type];
}
struct request *
request_create(u32 type, struct tbuf *data)
{
if (request_check_type(type)) {
say_error("Unsupported request = %" PRIi32 "", type);
tnt_raise(IllegalParams, :"unsupported command code, "
"check the error log");
}
request_check_type(type);
struct request *request = palloc(fiber->gc_pool, sizeof(struct request));
request->type = type;
...
...
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