Now that our MSRV is past 1.85, we can switch to the 2024 edition. This
changes some minor behavior in the language and exposes new lints (both
from check and clippy). In particular, unsafe functions now require
unsafe blocks to call other unsafe functions; this is quite a nice
change as it exposes more places where safety comments are needed.
* Add regression test for immediate EOF on stream
* Fix dropped responses when DNS stream encounters EOF
The `stream::Transport` loop did not account for responses that had been
added to the reply channel prior to `reader_fut` returning. If a server
sent a response and immediately closed the stream afterwards, that
response was lost. I fixed the bug by adding an explicit check for any
remaining items from `reply_receiver` in the `reader_fut` select branch.
Additionally, the `Transport::error` function did not await the futures
returned by `ReplySender::send`. This meant the errors were never sent
and instead the channel closed without any message. I fixed that by
making `Transort::error` an async fn.
The PR additionally contains a regression test. Running it without the
fix fails, but with the fixes it passes. I did not use stelline for this
test as it requires a very specific order of IO events on the
connection.
- Automatically determine the MSRV.
- Rebuild 'main' every week to catch environmental changes.
- Run Clippy in a dedicated job to be more parallel.
- Only run it on Ubuntu.
- Introduce caching of '~/.cargo' and '/target'.
- Only save it on 'main', but restore it in all other jobs.
- Preserve OpenSSL-excluding behavior for Windows.
responses. (#377)
This adds ComposeRequestMulti and other *Multi types. The main change is to
the stream transport, which is the only transport that implements
SendRequestMulti.
- Re-enable the cookies Stelline test and fix `CookiesMiddlewareProcessor` to allow requests with invalid cookies to proceed if they are authenticated or not required to authenticate.
- Add support for net blocks in the deny list of the cookie middleware processor, ala Unbound, otherwise the deny list is difficult to use beyond a few simple specific IP addresses.
- Improvements to the Stelline server test support needed by the Stelline cookies test:
- Advance mock system time in the Stelline server tests.
- Move Stelline server tests under src/ to permit #cfg(test) based swap out of real system time for mock system time.
- Use the thread_local version of mock_instant to ensure parallel mock time dependent tests don't interfere with each other (such tests also use tokio::time which only works if they run in a single thread).
- Set mock system time to start at zero for each Stelline server test (as expected by the cookies .rpl test script).
- Pass the IP address of the test client to the server so that the cookies middleware can match it against its deny list.
This PR renames all types and functions that refer to domain name from using
the term “dname” to just “name.” For instance, Dname becomes Name, ToDname
becomes ToName, and ToDname::to_dname becomes ToName::to_name.
This annoyingly wide-reaching change is motivated by a clash with the DNAME
record type that would always be confusing. So we rather do it now.
This is a really breaking change. Apologies.
This PR adds zonefile/parsed.rs, zonetree/ and related examples/, which
together enable, and show a library user how, to go from a zone file in
presentation format to an in-memory tree of zones which can be queried to
provide an answer, or walked (iterated over).
The tree also supports versioned write operations and a trait based zone
implementation allowing for the in-memory tree for a zone to instead be some
other (a)synchornous backing store (as demonstrated by the mysql-zone.rs
example).
The zonetree module is feature-gated behind the unstable-zonetree feature.
This PR adds an unstable net::server module that enables the creation of UDP
and TCP DNS servers using base transport server, middleware and service building blocks.
This PR changes the types for the IANA registered values into structs
wrapping underlying integer types and provides the values as constants. This
mostly just changes the spelling of those values. However, it also required
some re-wiring of the type generation macros for record data and opt data
since the type names and value names differ now.
This is a breaking change.
This PR changes the ToDname and ToRelativeDname traits to have a pair of
methods for each conversion that either return a result or just a success
value depending on whether the octets builder used for the name can fail.
This should allow removing quite a few unwraps when e.g. Vec<u8> or Bytes
are used.
This is a breaking change.
This PR adds experimental support for client transport of DNS messages.
It also adds a new concept of unstable features which gate code that can introduce breaking changes also in non-breaking releases.