aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/c-ares/ares_data.c
diff options
context:
space:
mode:
authorsnermolaev <snermolaev@yandex-team.ru>2022-02-10 16:45:53 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:53 +0300
commit7353a3fdea9c67c256980c00a2b3b67f09b23a27 (patch)
tree1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /contrib/libs/c-ares/ares_data.c
parent2015790ac9fcc04caab83fccc23ab2460310a797 (diff)
downloadydb-7353a3fdea9c67c256980c00a2b3b67f09b23a27.tar.gz
Restoring authorship annotation for <snermolaev@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/c-ares/ares_data.c')
-rw-r--r--contrib/libs/c-ares/ares_data.c178
1 files changed, 89 insertions, 89 deletions
diff --git a/contrib/libs/c-ares/ares_data.c b/contrib/libs/c-ares/ares_data.c
index 34db47fcbd..18dd650c7b 100644
--- a/contrib/libs/c-ares/ares_data.c
+++ b/contrib/libs/c-ares/ares_data.c
@@ -40,9 +40,9 @@
void ares_free_data(void *dataptr)
{
- while (dataptr != NULL) {
- struct ares_data *ptr;
- void *next_data = NULL;
+ while (dataptr != NULL) {
+ struct ares_data *ptr;
+ void *next_data = NULL;
#ifdef __INTEL_COMPILER
# pragma warning(push)
@@ -50,82 +50,82 @@ void ares_free_data(void *dataptr)
/* 1684: conversion from pointer to same-sized integral type */
#endif
- ptr = (void *)((char *)dataptr - offsetof(struct ares_data, data));
+ ptr = (void *)((char *)dataptr - offsetof(struct ares_data, data));
#ifdef __INTEL_COMPILER
# pragma warning(pop)
#endif
- if (ptr->mark != ARES_DATATYPE_MARK)
- return;
-
- switch (ptr->type)
- {
- case ARES_DATATYPE_MX_REPLY:
-
- if (ptr->data.mx_reply.next)
- next_data = ptr->data.mx_reply.next;
- if (ptr->data.mx_reply.host)
- ares_free(ptr->data.mx_reply.host);
- break;
-
- case ARES_DATATYPE_SRV_REPLY:
-
- if (ptr->data.srv_reply.next)
- next_data = ptr->data.srv_reply.next;
- if (ptr->data.srv_reply.host)
- ares_free(ptr->data.srv_reply.host);
- break;
-
- case ARES_DATATYPE_TXT_REPLY:
- case ARES_DATATYPE_TXT_EXT:
-
- if (ptr->data.txt_reply.next)
- next_data = ptr->data.txt_reply.next;
- if (ptr->data.txt_reply.txt)
- ares_free(ptr->data.txt_reply.txt);
- break;
-
- case ARES_DATATYPE_ADDR_NODE:
-
- if (ptr->data.addr_node.next)
- next_data = ptr->data.addr_node.next;
- break;
-
- case ARES_DATATYPE_ADDR_PORT_NODE:
-
- if (ptr->data.addr_port_node.next)
- next_data = ptr->data.addr_port_node.next;
- break;
-
- case ARES_DATATYPE_NAPTR_REPLY:
-
- if (ptr->data.naptr_reply.next)
- next_data = ptr->data.naptr_reply.next;
- if (ptr->data.naptr_reply.flags)
- ares_free(ptr->data.naptr_reply.flags);
- if (ptr->data.naptr_reply.service)
- ares_free(ptr->data.naptr_reply.service);
- if (ptr->data.naptr_reply.regexp)
- ares_free(ptr->data.naptr_reply.regexp);
- if (ptr->data.naptr_reply.replacement)
- ares_free(ptr->data.naptr_reply.replacement);
- break;
-
- case ARES_DATATYPE_SOA_REPLY:
- if (ptr->data.soa_reply.nsname)
- ares_free(ptr->data.soa_reply.nsname);
- if (ptr->data.soa_reply.hostmaster)
- ares_free(ptr->data.soa_reply.hostmaster);
- break;
-
- default:
- return;
- }
-
- ares_free(ptr);
- dataptr = next_data;
- }
+ if (ptr->mark != ARES_DATATYPE_MARK)
+ return;
+
+ switch (ptr->type)
+ {
+ case ARES_DATATYPE_MX_REPLY:
+
+ if (ptr->data.mx_reply.next)
+ next_data = ptr->data.mx_reply.next;
+ if (ptr->data.mx_reply.host)
+ ares_free(ptr->data.mx_reply.host);
+ break;
+
+ case ARES_DATATYPE_SRV_REPLY:
+
+ if (ptr->data.srv_reply.next)
+ next_data = ptr->data.srv_reply.next;
+ if (ptr->data.srv_reply.host)
+ ares_free(ptr->data.srv_reply.host);
+ break;
+
+ case ARES_DATATYPE_TXT_REPLY:
+ case ARES_DATATYPE_TXT_EXT:
+
+ if (ptr->data.txt_reply.next)
+ next_data = ptr->data.txt_reply.next;
+ if (ptr->data.txt_reply.txt)
+ ares_free(ptr->data.txt_reply.txt);
+ break;
+
+ case ARES_DATATYPE_ADDR_NODE:
+
+ if (ptr->data.addr_node.next)
+ next_data = ptr->data.addr_node.next;
+ break;
+
+ case ARES_DATATYPE_ADDR_PORT_NODE:
+
+ if (ptr->data.addr_port_node.next)
+ next_data = ptr->data.addr_port_node.next;
+ break;
+
+ case ARES_DATATYPE_NAPTR_REPLY:
+
+ if (ptr->data.naptr_reply.next)
+ next_data = ptr->data.naptr_reply.next;
+ if (ptr->data.naptr_reply.flags)
+ ares_free(ptr->data.naptr_reply.flags);
+ if (ptr->data.naptr_reply.service)
+ ares_free(ptr->data.naptr_reply.service);
+ if (ptr->data.naptr_reply.regexp)
+ ares_free(ptr->data.naptr_reply.regexp);
+ if (ptr->data.naptr_reply.replacement)
+ ares_free(ptr->data.naptr_reply.replacement);
+ break;
+
+ case ARES_DATATYPE_SOA_REPLY:
+ if (ptr->data.soa_reply.nsname)
+ ares_free(ptr->data.soa_reply.nsname);
+ if (ptr->data.soa_reply.hostmaster)
+ ares_free(ptr->data.soa_reply.hostmaster);
+ break;
+
+ default:
+ return;
+ }
+
+ ares_free(ptr);
+ dataptr = next_data;
+ }
}
@@ -144,7 +144,7 @@ void *ares_malloc_data(ares_datatype type)
{
struct ares_data *ptr;
- ptr = ares_malloc(sizeof(struct ares_data));
+ ptr = ares_malloc(sizeof(struct ares_data));
if (!ptr)
return NULL;
@@ -164,10 +164,10 @@ void *ares_malloc_data(ares_datatype type)
ptr->data.srv_reply.port = 0;
break;
- case ARES_DATATYPE_TXT_EXT:
- ptr->data.txt_ext.record_start = 0;
- /* FALLTHROUGH */
-
+ case ARES_DATATYPE_TXT_EXT:
+ ptr->data.txt_ext.record_start = 0;
+ /* FALLTHROUGH */
+
case ARES_DATATYPE_TXT_REPLY:
ptr->data.txt_reply.next = NULL;
ptr->data.txt_reply.txt = NULL;
@@ -181,15 +181,15 @@ void *ares_malloc_data(ares_datatype type)
sizeof(ptr->data.addr_node.addrV6));
break;
- case ARES_DATATYPE_ADDR_PORT_NODE:
- ptr->data.addr_port_node.next = NULL;
- ptr->data.addr_port_node.family = 0;
- ptr->data.addr_port_node.udp_port = 0;
- ptr->data.addr_port_node.tcp_port = 0;
- memset(&ptr->data.addr_port_node.addrV6, 0,
- sizeof(ptr->data.addr_port_node.addrV6));
- break;
-
+ case ARES_DATATYPE_ADDR_PORT_NODE:
+ ptr->data.addr_port_node.next = NULL;
+ ptr->data.addr_port_node.family = 0;
+ ptr->data.addr_port_node.udp_port = 0;
+ ptr->data.addr_port_node.tcp_port = 0;
+ memset(&ptr->data.addr_port_node.addrV6, 0,
+ sizeof(ptr->data.addr_port_node.addrV6));
+ break;
+
case ARES_DATATYPE_NAPTR_REPLY:
ptr->data.naptr_reply.next = NULL;
ptr->data.naptr_reply.flags = NULL;
@@ -211,7 +211,7 @@ void *ares_malloc_data(ares_datatype type)
break;
default:
- ares_free(ptr);
+ ares_free(ptr);
return NULL;
}