Commit Graph
55 Commits
Author SHA1 Message Date
David Fifield b0f99e72bb Handle other unknown response status codes the same as 429. 2020-04-18 16:02:14 -06:00
David Fifield e501935578 Handle 429 Too Many Requests. 2020-04-18 16:02:14 -06:00
David Fifield 973f6310c5 Don't expire ClientMap if timeout is zero. 2020-04-18 16:02:14 -06:00
David Fifield 317c2c43d0 Don't send User-Agent.
HTTP header now looks like
```
POST / HTTP/1.1
Host: 127.0.0.1:8000
Content-Length: 221
Accept: application/dns-message
Content-Type: application/dns-message
Accept-Encoding: gzip
```
2020-04-18 16:02:14 -06:00
David Fifield 087d3b25dd Refactor HTTP response handling. 2020-04-18 16:02:14 -06:00
David Fifield e772e7bf2f Add a timeout to HTTP requests and follow redirects. 2020-04-18 16:02:14 -06:00
David Fifield f69e4e0d71 Truncation and TC bit in responses. 2020-04-18 16:02:14 -06:00
David Fifield e53d332eca Reduce response delay to 1 s.
To be below the reported Quad9 timeout.
2020-04-18 16:02:14 -06:00
David Fifield 9c827e579c On third thought, do close send queues when expiring.
Callers don't have access to the queue except through WriteTo, so they
can't cause a panic by writing to a closed channel.
2020-04-18 16:02:14 -06:00
David Fifield 5350ea1e68 Increase initPollDelay to 500 ms. 2020-04-18 16:02:14 -06:00
David Fifield 7cbddf5fd9 Rework polling.
Give priority to data-carrying packets over polling packets.
Discard a polling packet whenever sending a data-carrying packet.
2020-04-18 16:02:14 -06:00
David Fifield 06144f76ae -dot mode. 2020-04-18 16:02:11 -06:00
David Fifield 1907daeba0 Simplify HTTPPacketConn. 2020-04-18 14:34:10 -06:00
David Fifield be9c3f1ac7 Refactor PacketConn handling. 2020-04-18 14:34:10 -06:00
David Fifield 0f65c5077c Use a global CipherSuite. 2020-04-18 14:34:10 -06:00
David Fifield 7f3e9e4571 Overlay a noise layer atop KCP. 2020-04-18 14:34:10 -06:00
David Fifield f2423f959a noise socket abstraction 2020-04-18 14:34:10 -06:00
David Fifield 3f98c62207 Log when there's an error opening a stream. 2020-04-18 14:34:10 -06:00
David Fifield f8b9d73493 Switch up order of query checks in server.
We should set the AA bit if it applies, even if there are things wrong
with the query. An EDNS(0)-related error supersedes all others.
2020-04-18 14:34:10 -06:00
David Fifield 0a568a386b Need to set RR class in responses.
The lack of this (Class==0) worked fine with Google UDP and DoH, and
Cloudflare UDP, but failed with Cloudflare DoH (the DoH resolver
stripped the TXT RR).
2020-04-18 14:34:04 -06:00
David Fifield a6c891c5ae -doh mode. 2020-04-18 14:33:39 -06:00
David Fifield aefe4f9971 Factor out a pattern for different kinds of remote address. 2020-04-18 14:33:39 -06:00
David Fifield 45c44e1c33 Factor out udp.go. 2020-04-18 14:33:39 -06:00
David Fifield 2cf79b1763 Log stream begin/end. 2020-04-18 14:33:39 -06:00
David Fifield 700291d6a1 MTU to log, not stdout. 2020-04-18 14:33:39 -06:00
David Fifield ea824f3658 Check for error from SetMtu. 2020-04-18 14:33:39 -06:00
David Fifield f2abcbf4de Larger downstream capacity. 2020-04-18 14:33:39 -06:00
David Fifield 0022cdd16c EDNS check 2020-04-18 14:33:39 -06:00
David Fifield 584dc3950d Advertise EDNS(0) in client. 2020-04-18 14:33:39 -06:00
David Fifield 163ae7f1b8 Per-message byte limit depends on name length. 2020-04-18 14:33:39 -06:00
David Fifield f1ee951fd6 Timer priority. 2020-04-18 14:33:39 -06:00
David Fifield 443a3ac855 delay resp 2020-04-18 14:33:39 -06:00
David Fifield 8aace665d5 Bundle multiple packets downstream. 2020-04-18 14:33:36 -06:00
David Fifield 410dafa29c Packetization server→client direction. 2020-04-18 14:29:30 -06:00
David Fifield 0a8e5f5b72 Packet framing downstream. 2020-04-18 14:29:30 -06:00
David Fifield ffcea8b633 Logging in client. 2020-04-18 14:29:30 -06:00
David Fifield 37b64f1825 On second thought, don't close send queues when expiring.
Could panic if a sender is holding on to the channel.
2020-04-18 14:29:30 -06:00
David Fifield 0ebbe21789 Don't explicitly send 0-length packets. 2020-04-18 14:29:30 -06:00
David Fifield 2050034fb1 Factor out separate sending and receiving threads. 2020-04-18 14:29:30 -06:00
David Fifield 5bb844b00a Logging in server. 2020-04-18 14:29:30 -06:00
David Fifield 933f17de78 Packetization and padding in the client→server direction. 2020-04-18 14:29:29 -06:00
David Fifield 0e72afd1e7 Downstream MTU. 2020-04-18 14:29:14 -06:00
David Fifield 22f5633521 Do name compression in writing. 2020-04-18 14:29:14 -06:00
David Fifield bf609a4cf8 Set MTU based on domain length. 2020-04-18 14:29:13 -06:00
David Fifield f47fa9781b Increasing poll interval. 2020-04-18 14:28:55 -06:00
David Fifield 1a630ef92f Automatic polling. 2020-04-18 14:28:55 -06:00
David Fifield 3b48d1aee1 Send full 8-byte ClientID
Sending just 4 bytes and relying on the convid for the remaining bytes
doesn't work for empty polling requests. Could probably just eliminate
the convid and make it a static constant before feeding to KCP.
2020-04-18 14:28:55 -06:00
David Fifield 9f72a8a87d client 2020-04-18 14:28:53 -06:00
David Fifield cfbbc9aaee Better command-line usage message. 2020-04-18 14:23:11 -06:00
David Fifield 6633ee8b8d Exchange payloads. 2020-04-18 14:23:11 -06:00