mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
Refactor isc_nm_xfr_allowed()
Return 'isc_result_t' type value instead of 'bool' to indicate the actual failure. Rename the function to something not suggesting a boolean type result. Make changes in the places where the API function is being used to check for the result code instead of a boolean value.
This commit is contained in:
@@ -2385,9 +2385,10 @@ isc_nm_bad_request(isc_nmhandle_t *handle) {
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
isc_nm_xfr_allowed(isc_nmhandle_t *handle) {
|
||||
isc_result_t
|
||||
isc_nm_xfr_checkperm(isc_nmhandle_t *handle) {
|
||||
isc_nmsocket_t *sock = NULL;
|
||||
isc_result_t result = ISC_R_NOPERM;
|
||||
|
||||
REQUIRE(VALID_NMHANDLE(handle));
|
||||
REQUIRE(VALID_NMSOCK(handle->sock));
|
||||
@@ -2396,14 +2397,13 @@ isc_nm_xfr_allowed(isc_nmhandle_t *handle) {
|
||||
|
||||
switch (sock->type) {
|
||||
case isc_nm_streamdnssocket:
|
||||
return (isc__nm_streamdns_xfr_allowed(sock));
|
||||
result = isc__nm_streamdns_xfr_checkperm(sock);
|
||||
break;
|
||||
default:
|
||||
return (false);
|
||||
break;
|
||||
}
|
||||
|
||||
UNREACHABLE();
|
||||
|
||||
return (false);
|
||||
return (result);
|
||||
}
|
||||
|
||||
bool
|
||||
|
Reference in New Issue
Block a user