[Asterisk-code-review] DNS: Create a system-level DNS resolver (asterisk[master])

Ashley Sanders asteriskteam at digium.com
Tue Jun 30 22:45:18 CDT 2015


Ashley Sanders has posted comments on this change.

Change subject: DNS: Create a system-level DNS resolver
......................................................................


Patch Set 3:

(1 comment)

https://gerrit.asterisk.org/#/c/749/3/main/dns.c
File main/dns.c:

Line 481: 			if (record_handler) {
        : 				record_handler(context, answer, ntohs(ans->size), ans->ttl);
        : 				ret = DNS_SEARCH_SUCCESS;
        : 			}
> Okay. That sounds reasonable.
Oh, one more thought regarding point #1: the original code was not failing due to a parsing error, but rather receiving a return value less than zero from the callback function itself. This is misleading because as written, it is difficult to understand at first glance what the intent is. Also, when you break it down, the original code obscures the source of the actual failure. An API consumer's callback failing does not have any bearing on whether or not the DNS searcher and DNS response parser are able to successfully perform their respective tasks. If the application is supposed to fall on its sword and fail fast, I think it should happen inside the callback where the problem occurred.


-- 
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: 3
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: Mark Michelson <mmichelson at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list