Skip to content

Commit 6d56345

Browse files
committed
A few small bug fixes
1 parent 98478f1 commit 6d56345

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

context.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,8 @@ context_set_dns_transport(getdns_context *context, PyObject *py_value)
144144
PyErr_SetString(PyExc_AttributeError, GETDNS_RETURN_INVALID_PARAMETER_TEXT);
145145
return -1;
146146
}
147-
if (!((value == GETDNS_TRANSPORT_UDP_FIRST_AND_FALL_BACK_TO_TCP) ||
148-
(value == GETDNS_TRANSPORT_UDP_ONLY)) ||
149-
(value == GETDNS_TRANSPORT_TCP_ONLY) ||
150-
(value == GETDNS_TRANSPORT_TCP_ONLY_KEEP_CONNECTIONS_OPEN)) {
147+
if ((value < GETDNS_TRANSPORT_UDP_FIRST_AND_FALL_BACK_TO_TCP) ||
148+
(value > GETDNS_TRANSPORT_TCP_ONLY_KEEP_CONNECTIONS_OPEN)) {
151149
PyErr_SetString(PyExc_AttributeError, GETDNS_RETURN_INVALID_PARAMETER_TEXT);
152150
return -1;
153151
}
@@ -671,6 +669,7 @@ context_getattro(PyObject *self, PyObject *nameobj)
671669
}
672670
return PyString_FromString((char *)version_string->data);
673671
}
672+
#if 0
674673
if (!strncmp(attrname, "resolver_type", strlen("resolver_type"))) {
675674
uint32_t resolver_type;
676675
if ((ret = getdns_dict_get_int(api_info, "resolver_type", &resolver_type)) != GETDNS_RETURN_GOOD) {
@@ -681,6 +680,7 @@ context_getattro(PyObject *self, PyObject *nameobj)
681680
}
682681
return PyInt_FromLong(resolver_type);
683682
}
683+
#endif
684684

685685
if (!strncmp(attrname, "timeout", strlen("timeout"))) {
686686
uint32_t timeout;

doc/functions.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,6 @@ as its methods and attributes.
194194
*request_type* argument:
195195

196196
* In ``getdns.address()``, the name argument can only take a host name.
197-
* You do not need to include a ``return_both_v4_and_v6`` extension with the call in ``getdns.address()``; it will
198-
always return both IPv4 and IPv6 addresses.
199197
* ``Context.address()`` always uses all of namespaces from the
200198
context (to better emulate getaddrinfo()), while ``Context.general()`` only uses the DNS namespace.
201199

getdns.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ PyMemberDef Context_members[] = {
9696
"string set by the implementer" },
9797
{ "version_string", T_STRING|READONLY, offsetof(getdns_ContextObject, version_string), 0,
9898
"string set by the implementer" },
99-
{ "resolver_type", T_INT|READONLY, offsetof(getdns_ContextObject, resolver_type), 0,
100-
"the type of resolver the API is acting as in this context" },
10199
{ NULL }
102100
};
103101

pygetdns.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ typedef struct {
6666
getdns_list *upstream_recursive_servers;
6767
char *implementation_string;
6868
char *version_string;
69-
uint32_t resolver_type;
7069
} getdns_ContextObject;
7170

7271

0 commit comments

Comments
 (0)