"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/lib/ares_create_query.c" between
c-ares-1.17.1.tar.gz and c-ares-1.17.2.tar.gz

About: c-ares is a C library for asynchronous DNS requests (including name resolves).

ares_create_query.c  (c-ares-1.17.1):ares_create_query.c  (c-ares-1.17.2)
skipping to change at line 22 skipping to change at line 22
* M.I.T. makes no representations about the suitability of * M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is" * this software for any purpose. It is provided "as is"
* without express or implied warranty. * without express or implied warranty.
*/ */
#include "ares_setup.h" #include "ares_setup.h"
#ifdef HAVE_NETINET_IN_H #ifdef HAVE_NETINET_IN_H
# include <netinet/in.h> # include <netinet/in.h>
#endif #endif
#ifdef HAVE_ARPA_NAMESER_H
# include <arpa/nameser.h> #include "ares_nameser.h"
#else
# include "nameser.h"
#endif
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
# include <arpa/nameser_compat.h>
#endif
#include "ares.h" #include "ares.h"
#include "ares_dns.h" #include "ares_dns.h"
#include "ares_private.h" #include "ares_private.h"
#ifndef T_OPT
# define T_OPT 41 /* EDNS0 option (meta-RR) */
#endif
/* Header format, from RFC 1035: /* Header format, from RFC 1035:
* 1 1 1 1 1 1 * 1 1 1 1 1 1
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
* | ID | * | ID |
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
* |QR| Opcode |AA|TC|RD|RA| Z | RCODE | * |QR| Opcode |AA|TC|RD|RA| Z | RCODE |
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
* | QDCOUNT | * | QDCOUNT |
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
skipping to change at line 60 skipping to change at line 50
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
* | NSCOUNT | * | NSCOUNT |
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
* | ARCOUNT | * | ARCOUNT |
* +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
* *
* AA, TC, RA, and RCODE are only set in responses. Brief description * AA, TC, RA, and RCODE are only set in responses. Brief description
* of the remaining fields: * of the remaining fields:
* ID Identifier to match responses with queries * ID Identifier to match responses with queries
* QR Query (0) or response (1) * QR Query (0) or response (1)
* Opcode For our purposes, always QUERY * Opcode For our purposes, always O_QUERY
* RD Recursion desired * RD Recursion desired
* Z Reserved (zero) * Z Reserved (zero)
* QDCOUNT Number of queries * QDCOUNT Number of queries
* ANCOUNT Number of answers * ANCOUNT Number of answers
* NSCOUNT Number of name server records * NSCOUNT Number of name server records
* ARCOUNT Number of additional records * ARCOUNT Number of additional records
* *
* Question format, from RFC 1035: * Question format, from RFC 1035:
* 1 1 1 1 1 1 * 1 1 1 1 1 1
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
skipping to change at line 119 skipping to change at line 109
len = strlen(name) + 2 + HFIXEDSZ + QFIXEDSZ + len = strlen(name) + 2 + HFIXEDSZ + QFIXEDSZ +
(max_udp_size ? EDNSFIXEDSZ : 0); (max_udp_size ? EDNSFIXEDSZ : 0);
buf = ares_malloc(len); buf = ares_malloc(len);
if (!buf) if (!buf)
return ARES_ENOMEM; return ARES_ENOMEM;
/* Set up the header. */ /* Set up the header. */
q = buf; q = buf;
memset(q, 0, HFIXEDSZ); memset(q, 0, HFIXEDSZ);
DNS_HEADER_SET_QID(q, id); DNS_HEADER_SET_QID(q, id);
DNS_HEADER_SET_OPCODE(q, QUERY); DNS_HEADER_SET_OPCODE(q, O_QUERY);
if (rd) { if (rd) {
DNS_HEADER_SET_RD(q, 1); DNS_HEADER_SET_RD(q, 1);
} }
else { else {
DNS_HEADER_SET_RD(q, 0); DNS_HEADER_SET_RD(q, 0);
} }
DNS_HEADER_SET_QDCOUNT(q, 1); DNS_HEADER_SET_QDCOUNT(q, 1);
if (max_udp_size) { if (max_udp_size) {
DNS_HEADER_SET_ARCOUNT(q, 1); DNS_HEADER_SET_ARCOUNT(q, 1);
 End of changes. 4 change blocks. 
14 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)