summaryrefslogtreecommitdiff
path: root/dns/query.py
Commit message (Collapse)AuthorAgeFilesLines
* is_udp is better as Inbound attribute not parameter to process_message(). ↵Bob Halley2020-08-221-2/+3
| | | | Increase coverage.
* remove parameters that are no longer used in inbound_xfr()Bob Halley2020-08-221-11/+1
|
* Implement new inbound xfr design.xfrBob Halley2020-08-211-10/+127
|
* pylint lintingBob Halley2020-07-311-17/+17
|
* lintBob Halley2020-07-191-1/+1
|
* Disable coverage for BlockingIOError on udp send.Brian Wellington2020-07-171-1/+1
|
* Changes to blocking model.Brian Wellington2020-07-171-27/+40
| | | | | | | | | | | | | Before this change, the synchronous code would check sockets for readability or writability before doing nonblocking read or write. This changes them to attempt the read or write first, and then block if the operation could not complete. This also removes the no-longer-needed getpeername() call in tcp(), which was needed to deal with the case where an unconnected socket was passed in; waiting for writability would block rather than immediately return an error. By attempting the write first, we get the error immediately.
* Use the selectors module.Brian Wellington2020-07-171-71/+26
| | | | | | Previously, there was code to either use select.select or select.poll, depending on OS. This changes it to use the selectors module, using either SelectSelector or PollSelector, but sharing code otherwise.
* Add support for receiving UDP queries.Brian Wellington2020-07-081-12/+32
| | | | | | | | | | | | | | The existing receive_udp() methods are only usable for receiving responses, as they require an expected destination and check that the message is from that destination. This change makes the expected destination (and hence the check) optional, and returns the address that the message was received from (in the sync case, this is only done if no destination is provided, for backwards compatibility). New tests are added, which required adding generic getsockname() support to the async backends.
* Fix return type docs for receive methods.Brian Wellington2020-07-081-2/+4
|
* Remove the concept from "first" from TSIG.Brian Wellington2020-06-301-4/+1
| | | | | | | | | The sign() and validate() routines took a "first" parameter, which indicated that this message was the first in a multi-message sequence. This isn't needed, as it's identical to "not (ctx and multi)". Remove the parameter from both, as well as the now-unneeded field in the message object and message.from_wire() parameter.
* Use serial number arithmetic in IXFR.Bob Halley2020-06-271-1/+2
|
* improve query coverageBob Halley2020-06-181-10/+10
|
* The dns.inet.AF_* portability scheme is no longer needed.Bob Halley2020-06-161-4/+4
|
* avoid unneeded coverage warningsBob Halley2020-06-161-2/+2
|
* lintBob Halley2020-06-161-1/+1
|
* simplify DoH POSTBob Halley2020-06-161-2/+1
|
* simplify DoH GETBob Halley2020-06-161-4/+4
|
* Fix the DoH v6 literal fix.Bob Halley2020-06-161-11/+14
| | | | | | | My first try at this did not play well with the refactoring of _destination_and_source, as there will now be an af if source has one and destination doesn't. We only want to make special literal URLs when the destination is a literal.
* lintBob Halley2020-06-161-1/+0
|
* Overhaul _destination_and_source.Bob Halley2020-06-161-32/+45
| | | | | | | | | | | | | | | | | | | We now use dns.inet.low_level_address_tuple() for the low-level tuple conversion. We now detect mismatches between source and destination address families. If a source_port has been specified but we have no idea about the family, complain. (This can only happen when 'where' is a URL and no source address has been specified either.) 'where' MUST be an address literal unless being called by DoH code, but we tolerated failures in other cases. In the DoH case where 'where' was a URL and source was specified, the lack of an address family in the destination caused us to return None for the source, and thus not set it even though the caller asked for it. We now infer the address family from the source address in that case.
* Use the proper URL syntax for IPv6 address literals.Bob Halley2020-06-161-10/+10
|
* minor doco updateBob Halley2020-06-061-5/+7
|
* Minor Python 3 cleanups.Brian Wellington2020-06-031-3/+3
| | | | | | | Classes inherit from object by default; there's no need to explicitly include this. Replace super(Foo, self) with super().
* continued line lintBob Halley2020-06-011-1/+1
|
* Adds sock parameters to query methods.Brian Wellington2020-06-011-42/+93
| | | | | Allow passing a socket into dns.query.{udp,tcp,tls,udp_with_fallback}, and add tests for this.
* revision of truncation handlingBob Halley2020-05-221-4/+57
|
* remove historical af argument to query functionsBob Halley2020-05-211-35/+10
|
* Remove dns.rdata{type,class}.to_enum.Brian Wellington2020-05-211-1/+1
| | | | | | | These methods (which convert a str/int into an enum/int) shouldn't be commonly used by external code, so don't need to exist at the module level. The make() method on the enum class (renamed from to_enum()) can still be used, and the internal callers have been updated to use it.
* lint: remove unused sys importBob Halley2020-05-211-1/+0
|
* Use context managers in the query methods.Brian Wellington2020-05-201-56/+33
|
* Simplify dns.query._connect().Brian Wellington2020-05-201-13/+6
|
* Start converting rdatatype/rdataclass to enum.Brian Wellington2020-05-181-2/+1
|
* flake8 lintingBob Halley2020-05-151-6/+10
|
* Fix documentation cut and paste error.Brian Wellington2020-05-111-2/+2
|
* in doco, text->str, binary->bytesBob Halley2020-05-081-18/+18
|
* remove send_https() as the send/receive split is too hard for HTTPS and it ↵Bob Halley2020-05-081-17/+1
| | | | is not adding anything over https()
* Do not lose scope info. [Issue #283]Bob Halley2020-05-041-2/+5
|
* more things to make mypy happierBob Halley2020-05-031-1/+1
|
* Use context managers to simplify code.Brian Wellington2020-05-011-9/+4
| | | | | | | | Simplify code using try/finally to use context managers. In some cases, contextlib.ExitStack() is used; this could probably be further simplified to use contextlib.nullcontext() once Python 3.7+ is a requirement.
* Merge pull request #460 from bwelling/remove-futureBob Halley2020-05-011-2/+0
|\ | | | | Remove "from __future__ import" statements.
| * Remove "from __future__ import" statements.Brian Wellington2020-05-011-2/+0
| | | | | | | | None of these are needed anymore.
* | make DOH an extra feature (to avoid requests as hard dependency)Daniel Lenski2020-04-301-3/+18
|/
* prevent fd from leaking (fix #351)kimbo2020-02-261-101/+98
|
* DoH cleanup.Brian Wellington2020-01-071-36/+68
|
* send_https() and test for itkimbo2019-12-301-0/+14
|
* typokimbo2019-12-301-1/+1
|
* added bootstrap address option to https()kimbo2019-12-301-14/+21
|
* remove comment and session.close()kimbo2019-12-301-35/+31
|
* req'd session param to https() for connection reusekimbo2019-12-301-4/+6
|