Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Kea
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sebastian Schrader
Kea
Commits
7ec44914
Commit
7ec44914
authored
Jan 07, 2011
by
Jelte Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
folded some long lines
parent
a030bd71
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
src/lib/config/ccsession.cc
src/lib/config/ccsession.cc
+8
-3
src/lib/config/module_spec.cc
src/lib/config/module_spec.cc
+4
-2
No files found.
src/lib/config/ccsession.cc
View file @
7ec44914
...
...
@@ -315,18 +315,23 @@ ModuleCCSession::checkCommand() {
if
(
target_module
==
module_name_
)
{
if
(
command_handler_
)
{
ElementPtr
errors
=
Element
::
createList
();
if
(
module_specification_
.
validate_command
(
cmd_str
,
arg
,
errors
))
{
if
(
module_specification_
.
validate_command
(
cmd_str
,
arg
,
errors
))
{
answer
=
command_handler_
(
cmd_str
,
arg
);
}
else
{
std
::
stringstream
ss
;
ss
<<
"Error in command validation: "
;
BOOST_FOREACH
(
ConstElementPtr
error
,
errors
->
listValue
())
{
BOOST_FOREACH
(
ConstElementPtr
error
,
errors
->
listValue
())
{
ss
<<
error
->
stringValue
();
}
answer
=
createAnswer
(
3
,
ss
.
str
());
}
}
else
{
answer
=
createAnswer
(
1
,
"Command given but no command handler for module"
);
answer
=
createAnswer
(
1
,
"Command given but no "
"command handler for module"
);
}
}
}
...
...
src/lib/config/module_spec.cc
View file @
7ec44914
...
...
@@ -190,7 +190,8 @@ ModuleSpec::validate_command(const std::string& command,
ConstElementPtr
commands_spec
=
module_specification
->
find
(
"commands"
);
if
(
args
->
getType
()
!=
Element
::
map
)
{
errors
->
add
(
Element
::
create
(
"args for command "
+
command
+
" is not a map"
));
errors
->
add
(
Element
::
create
(
"args for command "
+
command
+
" is not a map"
));
return
(
false
);
}
...
...
@@ -202,7 +203,8 @@ ModuleSpec::validate_command(const std::string& command,
BOOST_FOREACH
(
ConstElementPtr
cur_command
,
commands_spec
->
listValue
())
{
if
(
cur_command
->
get
(
"command_name"
)
->
stringValue
()
==
command
)
{
return
(
validate_spec_list
(
cur_command
->
get
(
"command_args"
),
args
,
true
,
errors
));
return
(
validate_spec_list
(
cur_command
->
get
(
"command_args"
),
args
,
true
,
errors
));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment