Commit 138f5480 authored by Evan Hunt's avatar Evan Hunt
Browse files

style and grammar tweaks

parent b1b5edda
Pipeline #1210 passed with stages
in 6 minutes and 44 seconds
......@@ -4217,14 +4217,17 @@ badresp:1,adberr:0,findfail:0,valfail:0]
<term><command>atr-size</command></term>
<listitem>
<para>
For UDP, specifies the minimum size of the DNS reply
message for which an additional truncated response (ATR)
will be sent after a delay of
<command>atr-delay</command> milliseconds. If a large
DNS response message is lost somehow, this feature the
delayed truncated response would still come through,
enabling quick progress to TCP. The default value is
65536 which effectively disables this facility.
Specifies the size threshold for sending an additional
truncated response (ATR). When sending a DNS response over
UDP, any message larger than this threshold will be followed,
after a delay of <command>atr-delay</command> milliseconds,
with a truncated (TC=1) message matching the query.
If a large DNS response message is lost in transit --
for example, because of a badly configured firewall --
then the delayed truncated response should still come
through, enabling the client to quickly retry with TCP.
The default value is 65536, which effectively disables
this feature as DNS messages cannot be larger than that.
</para>
</listitem>
</varlistentry>
......
......@@ -610,15 +610,19 @@ exit_check(ns_client_t *client) {
isc_event_free((isc_event_t **)&client->sendevent);
isc_event_free((isc_event_t **)&client->recvevent);
isc_timer_detach(&client->timer);
if (client->delaytimer != NULL)
if (client->delaytimer != NULL) {
isc_timer_detach(&client->delaytimer);
}
if (client->atrdelaytimer != NULL)
if (client->atrdelaytimer != NULL) {
isc_timer_detach(&client->atrdelaytimer);
}
if (client->tcpbuf != NULL)
if (client->tcpbuf != NULL) {
isc_mem_put(client->mctx, client->tcpbuf,
TCP_BUFFER_SIZE);
}
if (client->opt != NULL) {
INSIST(dns_rdataset_isassociated(client->opt));
dns_rdataset_disassociate(client->opt);
......@@ -878,11 +882,12 @@ client_senddone(isc_task_t *task, isc_event_t *event) {
CTRACE("senddone");
if (sevent->result != ISC_R_SUCCESS)
if (sevent->result != ISC_R_SUCCESS) {
ns_client_log(client, NS_LOGCATEGORY_CLIENT,
NS_LOGMODULE_CLIENT, ISC_LOG_WARNING,
"error sending response: %s",
isc_result_totext(sevent->result));
}
INSIST(client->nsends > 0);
client->nsends--;
......@@ -894,9 +899,11 @@ client_senddone(isc_task_t *task, isc_event_t *event) {
}
/*
* If the successfully sent reply message over UDP was not
* truncated and also too large, send additional truncated
* response (draft-song-atr-large-resp-00).
* If we have successfully sent a non-truncated reply message
* over UDP which was larger than the configured ATR size limit,
* then we now send an additional truncated response; this
* enables the client to re-query over TCP if the first answer
* didn't go through (draft-song-atr-large-resp-00).
*/
if ((sevent->result == ISC_R_SUCCESS) && (!TCP_CLIENT(client)) &&
((client->message->flags & DNS_MESSAGEFLAG_TC) == 0) &&
......@@ -907,14 +914,17 @@ client_senddone(isc_task_t *task, isc_event_t *event) {
isc_interval_t interval;
ns_client_attach(client, &dummy);
if (client->sctx->atrdelay >= 1000)
if (client->sctx->atrdelay >= 1000) {
/* delay >= 1 sec */
isc_interval_set(&interval,
client->sctx->atrdelay / 1000U,
((client->sctx->atrdelay % 1000U) *
1000000U));
else
} else {
/* delay < 1 sec */
isc_interval_set(&interval, 0,
client->sctx->atrdelay * 1000000U);
}
result = isc_timer_create(client->manager->timermgr,
isc_timertype_once, NULL, &interval,
client->task, client_atrdelay,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment