mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-02 07:35:26 +00:00
276. [bug] dig now supports maximum sized TCP messages.
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -1,3 +1,5 @@
|
|||||||
|
276. [bug] dig now supports maximum sized TCP messages.
|
||||||
|
|
||||||
275. [bug] The definition of lwres_gai_strerror() was missing
|
275. [bug] The definition of lwres_gai_strerror() was missing
|
||||||
the lwres_ prefix.
|
the lwres_ prefix.
|
||||||
|
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: dig.c,v 1.50 2000/06/22 22:37:29 mws Exp $ */
|
/* $Id: dig.c,v 1.51 2000/06/23 16:53:53 marka Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -306,6 +306,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
|
|||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
dns_messagetextflag_t flags;
|
dns_messagetextflag_t flags;
|
||||||
isc_buffer_t *buf = NULL;
|
isc_buffer_t *buf = NULL;
|
||||||
|
unsigned int len = OUTPUTBUF;
|
||||||
|
|
||||||
UNUSED (query);
|
UNUSED (query);
|
||||||
|
|
||||||
@@ -329,7 +330,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
|
|||||||
|
|
||||||
result = ISC_R_SUCCESS;
|
result = ISC_R_SUCCESS;
|
||||||
|
|
||||||
result = isc_buffer_allocate(mctx, &buf, OUTPUTBUF);
|
result = isc_buffer_allocate(mctx, &buf, len);
|
||||||
check_result (result, "isc_buffer_allocate");
|
check_result (result, "isc_buffer_allocate");
|
||||||
|
|
||||||
if (query->lookup->comments && !short_form) {
|
if (query->lookup->comments && !short_form) {
|
||||||
@@ -391,17 +392,33 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
|
|||||||
|
|
||||||
if (query->lookup->section_question && headers) {
|
if (query->lookup->section_question && headers) {
|
||||||
if (!short_form) {
|
if (!short_form) {
|
||||||
|
question_again:
|
||||||
result = dns_message_sectiontotext(msg,
|
result = dns_message_sectiontotext(msg,
|
||||||
DNS_SECTION_QUESTION,
|
DNS_SECTION_QUESTION,
|
||||||
flags, buf);
|
flags, buf);
|
||||||
|
if (result == ISC_R_NOSPACE) {
|
||||||
|
len += OUTPUTBUF;
|
||||||
|
isc_buffer_free(&buf);
|
||||||
|
result = isc_buffer_allocate(mctx, &buf, len);
|
||||||
|
if (result == ISC_R_SUCCESS)
|
||||||
|
goto question_again;
|
||||||
|
}
|
||||||
check_result(result, "dns_message_sectiontotext");
|
check_result(result, "dns_message_sectiontotext");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (query->lookup->section_answer) {
|
if (query->lookup->section_answer) {
|
||||||
if (!short_form) {
|
if (!short_form) {
|
||||||
|
answer_again:
|
||||||
result = dns_message_sectiontotext(msg,
|
result = dns_message_sectiontotext(msg,
|
||||||
DNS_SECTION_ANSWER,
|
DNS_SECTION_ANSWER,
|
||||||
flags, buf);
|
flags, buf);
|
||||||
|
if (result == ISC_R_NOSPACE) {
|
||||||
|
len += OUTPUTBUF;
|
||||||
|
isc_buffer_free(&buf);
|
||||||
|
result = isc_buffer_allocate(mctx, &buf, len);
|
||||||
|
if (result == ISC_R_SUCCESS)
|
||||||
|
goto answer_again;
|
||||||
|
}
|
||||||
check_result(result, "dns_message_sectiontotext");
|
check_result(result, "dns_message_sectiontotext");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -411,17 +428,33 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
|
|||||||
}
|
}
|
||||||
if (query->lookup->section_authority) {
|
if (query->lookup->section_authority) {
|
||||||
if (!short_form) {
|
if (!short_form) {
|
||||||
|
authority_again:
|
||||||
result = dns_message_sectiontotext(msg,
|
result = dns_message_sectiontotext(msg,
|
||||||
DNS_SECTION_AUTHORITY,
|
DNS_SECTION_AUTHORITY,
|
||||||
flags, buf);
|
flags, buf);
|
||||||
|
if (result == ISC_R_NOSPACE) {
|
||||||
|
len += OUTPUTBUF;
|
||||||
|
isc_buffer_free(&buf);
|
||||||
|
result = isc_buffer_allocate(mctx, &buf, len);
|
||||||
|
if (result == ISC_R_SUCCESS)
|
||||||
|
goto authority_again;
|
||||||
|
}
|
||||||
check_result(result, "dns_message_sectiontotext");
|
check_result(result, "dns_message_sectiontotext");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (query->lookup->section_additional) {
|
if (query->lookup->section_additional) {
|
||||||
if (!short_form) {
|
if (!short_form) {
|
||||||
|
additional_again:
|
||||||
result = dns_message_sectiontotext(msg,
|
result = dns_message_sectiontotext(msg,
|
||||||
DNS_SECTION_ADDITIONAL,
|
DNS_SECTION_ADDITIONAL,
|
||||||
flags, buf);
|
flags, buf);
|
||||||
|
if (result == ISC_R_NOSPACE) {
|
||||||
|
len += OUTPUTBUF;
|
||||||
|
isc_buffer_free(&buf);
|
||||||
|
result = isc_buffer_allocate(mctx, &buf, len);
|
||||||
|
if (result == ISC_R_SUCCESS)
|
||||||
|
goto additional_again;
|
||||||
|
}
|
||||||
check_result(result, "dns_message_sectiontotext");
|
check_result(result, "dns_message_sectiontotext");
|
||||||
/* Only print the signature on the first record */
|
/* Only print the signature on the first record */
|
||||||
if (headers) {
|
if (headers) {
|
||||||
|
Reference in New Issue
Block a user