2016-05-12 04:36:12 +08:00
|
|
|
---
|
|
|
|
title: "mg_dns_send_reply()"
|
|
|
|
decl_name: "mg_dns_send_reply"
|
|
|
|
symbol_kind: "func"
|
|
|
|
signature: |
|
|
|
|
void mg_dns_send_reply(struct mg_connection *nc, struct mg_dns_reply *r);
|
|
|
|
---
|
|
|
|
|
2016-07-26 22:53:33 +08:00
|
|
|
Sends a DNS reply through a connection.
|
2016-05-12 04:36:12 +08:00
|
|
|
|
|
|
|
The DNS data is stored in an IO buffer pointed by reply structure in `r`.
|
|
|
|
This function mutates the content of that buffer in order to ensure that
|
2016-07-26 22:53:33 +08:00
|
|
|
the DNS header reflects the size and flags of the message, that might have
|
|
|
|
been updated either with `mg_dns_reply_record` or by direct manipulation of
|
2016-05-12 04:36:12 +08:00
|
|
|
`r->message`.
|
|
|
|
|
|
|
|
Once sent, the IO buffer will be trimmed unless the reply IO buffer
|
|
|
|
is the connection's send buffer and the connection is not in UDP mode.
|
|
|
|
|