Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Adam Osuchowski
Kea
Commits
8aaf38b8
Commit
8aaf38b8
authored
Apr 15, 2015
by
Marcin Siodelski
Browse files
[3198] Addressed review comments.
- Enabled log messages in user_chk - Fixed a typo
parent
8bafeba4
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/hooks/dhcp/user_chk/load_unload.cc
View file @
8aaf38b8
...
...
@@ -99,8 +99,8 @@ int load(LibraryHandle&) {
}
catch
(
const
std
::
exception
&
ex
)
{
// Log the error and return failure.
std
::
cout
<<
"DHCP UserCheckHook could not be loaded: "
<<
ex
.
what
()
<<
std
::
endl
;
LOG_ERROR
(
user_chk_logger
,
USER_CHK_HOOK_LOAD_ERROR
)
.
arg
(
ex
.
what
())
;
ret_val
=
1
;
}
...
...
@@ -121,8 +121,8 @@ int unload() {
}
catch
(
const
std
::
exception
&
ex
)
{
// On the off chance something goes awry, catch it and log it.
// @todo Not sure if we should return a non-zero result or not.
std
::
cout
<<
"DHCP UserCheckHook could not be unloaded: "
<<
ex
.
what
()
<<
std
::
endl
;
LOG_ERROR
(
user_chk_logger
,
USER_CHK_HOOK_UNLOAD_ERROR
)
.
arg
(
ex
.
what
())
;
}
return
(
0
);
...
...
src/hooks/dhcp/user_chk/subnet_select_co.cc
View file @
8aaf38b8
// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2013
,2015
Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
...
...
@@ -20,6 +20,7 @@
#include <dhcp/pkt6.h>
#include <dhcpsrv/subnet.h>
#include <user_chk.h>
#include <user_chk_log.h>
using
namespace
isc
::
dhcp
;
using
namespace
isc
::
hooks
;
...
...
@@ -49,8 +50,7 @@ extern "C" {
/// @return 0 upon success, non-zero otherwise.
int
subnet4_select
(
CalloutHandle
&
handle
)
{
if
(
!
user_registry
)
{
std
::
cout
<<
"DHCP UserCheckHook : subnet4_select UserRegistry is null"
<<
std
::
endl
;
LOG_ERROR
(
user_chk_logger
,
USER_CHK_SUBNET4_SELECT_REGISTRY_NULL
);
return
(
1
);
}
...
...
@@ -78,8 +78,8 @@ int subnet4_select(CalloutHandle& handle) {
handle
.
setArgument
(
"subnet4"
,
subnet
);
}
}
catch
(
const
std
::
exception
&
ex
)
{
std
::
cout
<<
"DHCP UserCheckHook : subnet6_select unexpected error: "
<<
ex
.
what
()
<<
std
::
endl
;
LOG_ERROR
(
user_chk_logger
,
USER_CHK_SUBNET4_SELECT_ERROR
)
.
arg
(
ex
.
what
())
;
return
(
1
);
}
...
...
@@ -104,8 +104,7 @@ int subnet4_select(CalloutHandle& handle) {
/// @return 0 upon success, non-zero otherwise.
int
subnet6_select
(
CalloutHandle
&
handle
)
{
if
(
!
user_registry
)
{
std
::
cout
<<
"DHCP UserCheckHook : subnet6_select UserRegistry is null"
<<
std
::
endl
;
LOG_ERROR
(
user_chk_logger
,
USER_CHK_SUBNET6_SELECT_REGISTRY_NULL
);
return
(
1
);
}
...
...
@@ -133,8 +132,8 @@ int subnet6_select(CalloutHandle& handle) {
handle
.
setArgument
(
"subnet6"
,
subnet
);
}
}
catch
(
const
std
::
exception
&
ex
)
{
std
::
cout
<<
"DHCP UserCheckHook : subnet6_select unexpected error: "
<<
ex
.
what
()
<<
std
::
endl
;
LOG_ERROR
(
user_chk_logger
,
USER_CHK_SUBNET6_SELECT_ERROR
)
.
arg
(
ex
.
what
())
;
return
(
1
);
}
...
...
src/lib/log/tests/message_initializer_1_unittest.cc
View file @
8aaf38b8
...
...
@@ -120,7 +120,7 @@ TEST(MessageInitializerTest1, dynamicLoadUnload) {
EXPECT_EQ
(
"global message nine"
,
global
->
getText
(
"GLOBAL9"
));
// Destroy the first initializer. The first two messages should
// be unregist
s
red.
// be unregist
e
red.
init1
.
reset
();
EXPECT_TRUE
(
global
->
getText
(
"GLOBAL7"
).
empty
());
EXPECT_TRUE
(
global
->
getText
(
"GLOBAL8"
).
empty
());
...
...
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