Commit Graph

1236 Commits

Author SHA1 Message Date
Benjamin Saunders 75d5c730de Fix unreliable unblocking of ordered reads
If an ordered read was blocked on a stream that had pending unordered
data and became blocked, `Recv::is_blocked` would have returned false,
leading to the application never getting notified. We could detect
whether *either* readiness boundary has been crossed, but the
more conservative approach is simple and obviously correct, and
spurious notifications are not known to be an issue.
2019-03-27 01:52:09 -07:00
Benjamin Saunders 1c24492c86 Don't start close timer on stateless reset 2019-03-27 01:52:09 -07:00
Benjamin Saunders bf6cf7387e Less error-prone timer cleanup 2019-03-27 01:52:09 -07:00
Benjamin Saunders 67de213a5a Only send PING in 1-RTT packets
In particular, don't send it in handshake packets we retransmit after
reaching 1-RTT.
2019-03-27 01:52:09 -07:00
Benjamin Saunders bc8bc6a17a Clarify logging 2019-03-27 01:52:09 -07:00
Benjamin Saunders 8be6ec3661 Don't set keep-alive during handshake 2019-03-27 01:52:09 -07:00
Benjamin Saunders 662b9483b8 Don't reset streams on dead connections
Fixes a panic that could happen when dropping streams from a
connection that's been closed.
2019-03-26 07:09:33 +01:00
Benjamin Saunders 2fb452259b Don't send PING in Handshake packets 2019-03-26 07:09:33 +01:00
Nikita Baksalyar 762bcf277b Add more debug info for the PROTOCOL_VIOLATION error
The error type should contain the frame causing the protocol violation
2019-03-25 20:21:21 +01:00
Dirkjan Ochtman eade6f4d9a Initialize EndpointInner in same file as definition 2019-03-23 21:40:06 +01:00
Dirkjan Ochtman b9410ce895 Import mpsc module for shorter type paths 2019-03-23 21:40:06 +01:00
Dirkjan Ochtman 5872661b8d Split up Driver::poll() into manageable parts 2019-03-23 19:10:36 +01:00
Dirkjan Ochtman ef0fb2b869 Pass datagram to Connection as a ConnectionEvent 2019-03-23 19:10:36 +01:00
Dirkjan Ochtman a6fec82b44 Change variable names in Endpoint that match Connection usage 2019-03-23 19:10:36 +01:00
Dirkjan Ochtman 5bbaf6d4b4 Tweak formatting for better readability 2019-03-23 19:10:36 +01:00
Dirkjan Ochtman 46ad36e34b Trigger connection forgetting through EndpointEvent 2019-03-23 19:10:36 +01:00
Dirkjan Ochtman 149bec5f8c Handle timer events as ConnectionEvent variants 2019-03-23 19:10:36 +01:00
Dirkjan Ochtman d29f186418 Rename poll_io() and remove unnecessary Io wrapper enum 2019-03-23 19:10:36 +01:00
Dirkjan Ochtman 753bddadb2 Retire connection identifiers through EndpointEvent 2019-03-23 19:10:36 +01:00
Dirkjan Ochtman 11cf1336a5 Send new connection IDs as a single event 2019-03-23 19:10:36 +01:00
Dirkjan Ochtman b689cfcecd Use events to communicate from Connection to Endpoint 2019-03-23 19:10:36 +01:00
Dirkjan Ochtman 18cfea2145 Keep local CIDs state in Endpoint 2019-03-23 19:10:36 +01:00
Dirkjan Ochtman d28dc2bb64 Move Endpoint-only state from Connection into Endpoint 2019-03-23 19:10:36 +01:00
Dirkjan Ochtman 41f7551e10 Leave debugging hint for stupid future me 2019-03-23 19:10:36 +01:00
Dirkjan Ochtman 481e7286c7 Return new ConnectionHandle from Endpoint::handle() 2019-03-23 19:10:36 +01:00
Dirkjan Ochtman 385fd39411 Clarify connection setup flow 2019-03-23 19:10:36 +01:00
Dirkjan Ochtman e4bd3f1597 Disable dual-stack IP test for now 2019-03-23 19:10:36 +01:00
Benjamin Saunders cada5cc194 Update quinn/src/lib.rs
Review incorporated

Co-Authored-By: ustulation <ustulation@gmail.com>
2019-03-21 11:10:34 +01:00
ustulation e468390802 API for obtaining our local endpoint
This is especially useful if we were binding to port 0 intending the OS to allocate us a random port. Then we would like to know what port was actually allocated. Besides it's a useful API anyway as it's natural to want to know this detail from a bound socket for completeness.
2019-03-21 11:10:34 +01:00
Benjamin Saunders 0a967f66e2 Relax 0-RTT frame type restrictions 2019-03-15 16:32:35 +01:00
Dirkjan Ochtman f5b066574a Move maybe_cleanup() method into Streams 2019-03-06 10:14:45 -08:00
Dirkjan Ochtman 65c3f2c7c6 Let Connection handle stream cleanup if necessary 2019-03-06 10:14:45 -08:00
Benjamin Saunders 27b5dfe541 Account for all UDP datagram bytes in anti-amplification
Authentication/correctness is an independent concern. Improves
behavior when coalesced 0-RTT is rejected.
2019-03-05 06:49:15 +01:00
Benjamin Saunders 5a3034b957 Update persistent congestion detection logic 2019-02-28 13:22:09 +01:00
Benjamin Saunders 7da5188ba8 Enable backtraces in CI 2019-02-28 13:17:09 +01:00
Benjamin Saunders d50edb67fb Expand ECN support
libc's CMSG macros got built out to many more platforms. There may
remain some obscure platforms where this will still fail to build, but
we can account for them as they show up in practice.
2019-02-28 13:17:09 +01:00
Dirkjan Ochtman 92deb61f60 Move Streams type into stream module 2019-02-27 19:13:45 +01:00
Dirkjan Ochtman 694b94a877 Reduce duplication of logic in stream read handling 2019-02-27 19:13:45 +01:00
Dirkjan Ochtman a22d79d6d2 Don't panic on reads of unknown streams 2019-02-27 19:13:45 +01:00
Benjamin Saunders 53143ad12a Limit volume of unacked stream data
This prevents a memory exhaustion DoS if a peer issues large amounts
of flow control credit without acknowledging stream data.
2019-02-27 09:20:38 +01:00
Benjamin Saunders 1585247830 Reduce send/recv starvation when CPU bound 2019-02-23 20:19:13 +01:00
Benjamin Saunders 7512d17e94 Don't rely on type inference in assert
This makes rustc nightly happier.
2019-02-23 19:38:18 +01:00
Benjamin Saunders f6563b26b9 Ensure cmsg buffer alignment 2019-02-23 19:38:18 +01:00
Benjamin Saunders feafacbf45 More robust cmsg handling 2019-02-23 19:38:18 +01:00
Benjamin Saunders cbf87e401f Fix version negotiation on outgoing connections 2019-02-23 19:33:15 +01:00
Benjamin Saunders aa8c293f1d Refactor cmsg write helper
Ancillary messages aren't necessarily singular.
2019-02-12 06:12:14 +01:00
Benjamin Saunders 455322e4a5 Fix sending ECN for IPv4 peers on dual-stack sockets 2019-02-12 06:12:14 +01:00
Jean-Christophe BEGUE 663650cca1 Merge pull request #233 from djc/dependabot/cargo/proptest-0.9.1
Update proptest requirement from 0.6.0 to 0.9.1
2019-02-11 08:43:14 +01:00
dependabot[bot] 90b5311fff Update proptest requirement from 0.6.0 to 0.9.1
Updates the requirements on [proptest](https://github.com/altsysrq/proptest) to permit the latest version.
- [Release notes](https://github.com/altsysrq/proptest/releases)
- [Changelog](https://github.com/AltSysrq/proptest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/altsysrq/proptest/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-02-11 04:48:21 +00:00
stammw 547fda3d6f Remove stale proptest dir 2019-02-09 11:15:50 +01:00