Commit e29c2b39 authored by Evan Hunt's avatar Evan Hunt

[master] fix misuses of isc__buffer functions, update comment

parent def81722
......@@ -2301,7 +2301,7 @@ query_dns64(ns_client_t *client, dns_name_t **namep, dns_rdataset_t *rdataset,
dns64 != NULL; dns64 = dns_dns64_next(dns64)) {
dns_rdataset_current(rdataset, &rdata);
isc__buffer_availableregion(buffer, &r);
isc_buffer_availableregion(buffer, &r);
INSIST(r.length >= 16);
result = dns_dns64_aaaafroma(dns64, &netaddr,
client->signer,
......
......@@ -2135,12 +2135,12 @@ check_tsig_error(dns_rdataset_t *rdataset, isc_buffer_t *b) {
if (tsig.error != 0) {
if (isc_buffer_remaininglength(b) < 1)
check_result(ISC_R_NOSPACE, "isc_buffer_remaininglength");
isc__buffer_putstr(b, "(" /*)*/);
isc_buffer_putstr(b, "(" /*)*/);
result = dns_tsigrcode_totext(tsig.error, b);
check_result(result, "dns_tsigrcode_totext");
if (isc_buffer_remaininglength(b) < 1)
check_result(ISC_R_NOSPACE, "isc_buffer_remaininglength");
isc__buffer_putstr(b, /*(*/ ")");
isc_buffer_putstr(b, /*(*/ ")");
}
}
......
......@@ -52,7 +52,7 @@ main(int argc, char **argv) {
fprintf(stderr, "error: %s\n", isc_result_totext(result));
return (1);
}
isc__buffer_usedregion(&buf, &r);
isc_buffer_usedregion(&buf, &r);
if (!strcasecmp(argv[1], "md5") ||
!strcasecmp(argv[1], "hmac-md5")) {
......
......@@ -582,8 +582,8 @@ ip2name(const dns_rpz_cidr_key_t *tgt_ip, dns_rpz_prefix_t tgt_prefix,
}
}
isc__buffer_init(&buffer, str, sizeof(str));
isc__buffer_add(&buffer, len);
isc_buffer_init(&buffer, str, sizeof(str));
isc_buffer_add(&buffer, len);
result = dns_name_fromtext(ip_name, &buffer, base_name, 0, NULL);
return (result);
}
......
......@@ -664,12 +664,12 @@ ISC_LANG_ENDDECLS
/*! \note
* XXXDCL Something more could be done with initializing buffers that
* point to const data. For example, a new function, isc_buffer_initconst,
* could be used, and a new boolean flag in the buffer structure could
* indicate whether the buffer was initialized with that function.
* (isc_bufer_init itself would be reprototyped to *not* have its "base"
* parameter be const.) Then if the boolean were true, the isc_buffer_put*
* functions could assert a contractual requirement for a non-const buffer.
* point to const data. For example, isc_buffer_constinit() could
* set a new boolean flag in the buffer structure indicating whether
* the buffer was initialized with that function. * Then if the
* boolean were true, the isc_buffer_put* functions could assert a
* contractual requirement for a non-const buffer.
*
* One drawback is that the isc_buffer_* functions (macros) that return
* pointers would still need to return non-const pointers to avoid compiler
* warnings, so it would be up to code that uses them to have to deal
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment