[Asterisk-code-review] DNS: Create a system-level DNS resolver (asterisk[master])
Ashley Sanders
asteriskteam at digium.com
Tue Jul 7 15:03:01 CDT 2015
Ashley Sanders has posted comments on this change.
Change subject: DNS: Create a system-level DNS resolver
......................................................................
Patch Set 7:
(14 comments)
https://gerrit.asterisk.org/#/c/749/7/include/asterisk/dns.h
File include/asterisk/dns.h:
Line 49: * \note Asterisk DNS is synchronus at this time. This means that if your DNS
: * services does not work, Asterisk may lock while waiting for response.
:
> ...your DNS service does...waiting for a response.
This is the same comment from the existing code. I only modified the documentation slightly to include the return values. See lines 33-34 from the Base Patch Set.
I have corrected the grammar for the next revision.
Line 55: /*! \brief Extended version of the DNS search function. Performs a DNS lookup, (used by
: * DNS, enum and SRV lookups), parses the results and notifies the observer with the
: * response and discovered records via invoking the provided callbacks (used by
: * ast_dns_system_resolver
> \brief should be a single line description of the function. Hence the term
Done. I also fixed:
main/dns.c, lines 396-397 and main/dns_system_resolver.c, line 70
Line 64: * \param response_handler Callback function for handling the DNS response. Invoked upon
: completion of the DNS search.
> Missing * at beginning of line.
Done.
Line 75: * \note Asterisk DNS is synchronus at this time. This means that if your DNS
: * services does not work, Asterisk may lock while waiting for response.
> ...your DNS service does...waiting for a response.
Yes, it was a copy of the original note. It's been corrected.
https://gerrit.asterisk.org/#/c/749/7/main/dns.c
File main/dns.c:
Line 203: if (x >= len)
: return AST_DNS_SEARCH_FAILURE;
> You might as well add the missing curlies while you're here.
Done.
Line 396: * \brief Extended version of the DNS Parsing function. Parses the DNS lookup result and notifies
\brief should be a single line description of the function. Use an additional \details tag when more than one line is needed.
Line 437: ast_log(LOG_WARNING, "Length of DNS answer exceeds available search frames \n");
Extraneous space before \n.
Line 463: ast_log(LOG_WARNING, "Length of DNS answer exceeds available search frames \n");
> Extraneous space before \n.
I also fixed this on lines 437 and 472
Line 472: ast_log(LOG_WARNING, "Length of DNS answer exceeds available search frames \n");
Extraneous space before \n.
Line 579: ast_log(LOG_WARNING, "DNS Parse error for %s\n", dname); /* Parsing Error */
: } else if (ret == AST_DNS_SEARCH_NO_RECORDS) {
: ast_log(LOG_WARNING, "DNS search yielded no results for %s\n", dname); /* No results found */
> 1) Tail comments are over 90 columns.
Done.
https://gerrit.asterisk.org/#/c/749/7/main/dns_system_resolver.c
File main/dns_system_resolver.c:
Line 70: * \brief Callback to handle processing an individual resource record discovered from ast_search_dns_ex.
\brief should be a single line description of the function. Use an additional \details tag when more than one line is needed.
Line 87: return ast_dns_resolver_add_record(query, /* The DNS query */
: ast_dns_query_get_rr_type(query), /* Resource record type */
: ast_dns_query_get_rr_class(query), /* Resource record class */
: ttl, /* TTL of the record */
: (const char*) record, /* The raw DNS record */
: record_len); /* The size of the raw DNS record */
> These tail comments go over column 90 because of the toothbrush formating.
I removed the comments. They were only there as a guide. The function parameters are documented within dns_resolver.h
Line 126: return;
> This return is redundant. It is the end of the function and it is a void f
Removed.
Line 157: ast_log(LOG_ERROR, "DNS search failed to yield any results for query: '%s'\n",
: ast_dns_query_get_name(query));
> Is this really an error?
No. That was probably a copy/paste typo. I think it would be a warning at most.
--
To view, visit https://gerrit.asterisk.org/749
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I3b36ea17b889a98df4f8d80d50bb7ee175afa077
Gerrit-PatchSet: 7
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Ashley Sanders <asanders at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Ashley Sanders <asanders at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-HasComments: Yes
More information about the asterisk-code-review
mailing list