aboutsummaryrefslogtreecommitdiff
path: root/deps/cares/src/ares_parse_txt_reply.c
diff options
context:
space:
mode:
authorFedor Indutny <fedor@indutny.com>2014-03-28 00:09:20 +0400
committerFedor Indutny <fedor@indutny.com>2014-04-24 10:40:35 +0400
commita60a9b0dbd064cd70de9400ad47421c19d29b021 (patch)
tree2b40c7250395e6cdeec2ff474cffdec738ff4f46 /deps/cares/src/ares_parse_txt_reply.c
parent3950024c2f54514916cb6e9fd5aec280a8823d3c (diff)
downloadandroid-node-v8-a60a9b0dbd064cd70de9400ad47421c19d29b021.tar.gz
android-node-v8-a60a9b0dbd064cd70de9400ad47421c19d29b021.tar.bz2
android-node-v8-a60a9b0dbd064cd70de9400ad47421c19d29b021.zip
deps: provide TXT chunk info in c-ares
Provide more information in `ares_txt_reply` to coalesce chunks from the same record into one string. fix #7367
Diffstat (limited to 'deps/cares/src/ares_parse_txt_reply.c')
-rw-r--r--deps/cares/src/ares_parse_txt_reply.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/deps/cares/src/ares_parse_txt_reply.c b/deps/cares/src/ares_parse_txt_reply.c
index 981db4cd54..dabf73cd3f 100644
--- a/deps/cares/src/ares_parse_txt_reply.c
+++ b/deps/cares/src/ares_parse_txt_reply.c
@@ -133,8 +133,6 @@ ares_parse_txt_reply (const unsigned char *abuf, int alen,
break;
}
- ++strptr;
-
/* Allocate storage for this TXT answer appending it to the list */
txt_curr = ares_malloc_data(ARES_DATATYPE_TXT_REPLY);
if (!txt_curr)
@@ -152,6 +150,7 @@ ares_parse_txt_reply (const unsigned char *abuf, int alen,
}
txt_last = txt_curr;
+ txt_curr->record_start = strptr == aptr;
txt_curr->length = substr_len;
txt_curr->txt = malloc (substr_len + 1/* Including null byte */);
if (txt_curr->txt == NULL)
@@ -159,6 +158,8 @@ ares_parse_txt_reply (const unsigned char *abuf, int alen,
status = ARES_ENOMEM;
break;
}
+
+ ++strptr;
memcpy ((char *) txt_curr->txt, strptr, substr_len);
/* Make sure we NULL-terminate */