Merge a new implementation of ast_inet_ntoa, our thread safe replacement for

inet_ntoa, which uses thread specific data (aka thread local storage) instead
of stack allocatted buffers to store the result.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2006-07-21 17:31:28 +00:00
parent 1861dcdff5
commit ca9ba719b6
19 changed files with 338 additions and 454 deletions

View File

@@ -172,10 +172,10 @@ static int dnsmgr_refresh(struct ast_dnsmgr_entry *entry, int verbose)
/* check to see if it has changed, do callback if requested (where de callback is defined ????) */
memcpy(&tmp, hp->h_addr, sizeof(tmp));
if (tmp.s_addr != entry->last.s_addr) {
ast_copy_string(iabuf, ast_inet_ntoa(entry->last), sizeof(iabuf));
ast_copy_string(iabuf2, ast_inet_ntoa(tmp), sizeof(iabuf2));
ast_log(LOG_NOTICE, "host '%s' changed from %s to %s\n",
entry->name,
ast_inet_ntoa(iabuf, sizeof(iabuf), entry->last),
ast_inet_ntoa(iabuf2, sizeof(iabuf2), tmp));
entry->name, iabuf, iabuf2);
memcpy(entry->result, hp->h_addr, sizeof(entry->result));
memcpy(&entry->last, hp->h_addr, sizeof(entry->last));
changed = entry->changed = 1;