Add mg_dns_encode_name_s for non-NUL terminated strings

PUBLISHED_FROM=012e2939021d1b275a39632fd2982891d2c98c4e
This commit is contained in:
Deomid Ryabkov authored and Cesanta Bot committed 2019-12-29 19:33:41 +00:00
1 parent cb602f178c
commit 10b11b03a8
4 files changed
+39 -20

No files matched your search

+1
View File
@@ -124,6 +124,7 @@ int mg_dns_encode_record(struct mbuf *io, struct mg_dns_resource_record *rr,
* Encodes a DNS name.
*/
int mg_dns_encode_name(struct mbuf *io, const char *name, size_t len);
int mg_dns_encode_name_s(struct mbuf *io, struct mg_str name);
/* Low-level: parses a DNS response. */
int mg_parse_dns(const char *buf, int len, struct mg_dns_message *msg);