Commit Graph

201 Commits

Author SHA1 Message Date
Miek Gieben 6c631cd4ff Implement Shutdown()
This is working for TCP, but for UDP the Read does not honor the
deadline settings.
2014-08-19 09:25:41 +00:00
Miek Gieben 292c925c9f update documentation 2014-08-18 22:21:02 +01:00
Miek Gieben 0d300b1fce Add deadline to the listeners
Call this deadline to the listener will timeout and we will get to
so if the server should shutdown.
2014-08-18 22:14:29 +01:00
Miek Gieben f3a6c86462 Implement Shutdown() call
And fix some tests to call Fatal().
2014-08-18 22:06:29 +01:00
Miek Gieben 6cf24a5637 Add a Shutdown method to server.
Allow gracefull shutdown of a server.
2014-08-18 20:30:10 +01:00
Miek Gieben eb2d26cb96 Remove Pool from server.
A noop for some time, remove it.
2014-08-18 20:29:54 +01:00
Miek Gieben fb3a1585ad fmt 2014-07-27 20:38:11 +01:00
Luke Young 0a6f133b26 Match format of other code 2014-07-27 10:44:39 -07:00
Luke Young 12f91af6ed Added ResponseWriter.LocalAddr support 2014-07-27 10:43:07 -07:00
Miek Gieben 62ee88c895 Documentation 2014-07-22 08:27:59 +01:00
Miek Gieben e1cb18539a Systemd support
Rename StartAndServe to ActivateAndServe and only use one PacketConn or
Listener. This just adds a new entry point into starting a server.
2014-07-21 15:24:55 +01:00
Miek Gieben d80ad4aae5 Add support for systemd socket activation 2014-07-18 20:32:17 +01:00
Miek Gieben d161b9087e Cleanup the PR a bit
Remove code and simplify some functions. Documentation is still on the
todo.
Also don't export any of these functions and/or types.
2014-07-09 21:02:21 +01:00
Omri Bahumi dea4cb300a [ISSUE-95] Send replies from the right source IP address
Fixes #95
2014-07-07 18:16:42 +03:00
Miek Gieben 2ec512f89b server: pool: remove pool implementation
Quite a lot of code for a tiny improvement. Lease the Pool boolean
option in server so current code does not break. Will be removed
in later versions.
2014-04-10 12:59:50 +00:00
Miek Gieben 8e37d3660d Merge branch 'master' of github.com:miekg/dns 2014-01-07 07:45:29 +00:00
Miek Gieben 560a1c65b0 update license in pool.go
remove some build lines as I have no idea what they are
supposed to be doing.
2014-01-06 10:00:25 +00:00
Miek Gieben aafa94f352 better docs 2014-01-05 19:45:30 +00:00
Miek Gieben ac2ee587b1 Pool cleanups, readd wait for TCP 2014-01-05 16:29:07 +00:00
Miek Gieben 05ace47df8 Start of better documentation 2014-01-05 14:14:19 +00:00
Miek Gieben 5c37b9e564 Merge conflict resolved 2014-01-05 14:09:03 +00:00
Miek Gieben 8954a6e7c5 Remove debug logging 2014-01-05 13:51:59 +00:00
Miek Gieben 77345b2073 Don't set timeout
This leads to fake connection in the udp query handling.
2014-01-05 13:41:40 +00:00
Miek Gieben 49ece3e490 Add a memory pool
Re-use memory for UDP queries.
2014-01-05 13:39:33 +00:00
Miek Gieben f094f37de3 Add shortbuf erorr too
Cleanup the pull request a bit.
2014-01-04 11:17:13 +00:00
Miek Gieben b1f108f79c Simplify client TCP write.
Use the same patch as in the server.
2014-01-04 08:30:08 +00:00
Armon Dadgar 0cf549278c Simplify the Write() for TCP based connections
Simplify the code path by using io.Copy to handle partial writes. Allocate `l` large enough to avoid a re-allocation. Potential short write fix.
2014-01-03 15:19:35 -08:00
Andrew Tunnell-Jones 58bb85e9b4 ServeMux's match should only case fold A-Z 2013-12-14 09:04:29 +00:00
Miek Gieben 39c7a972c3 typo in doc 2013-10-26 21:36:43 +01:00
Miek Gieben 717a8179f5 Use recommendation from RFC5966 and set idle timeout much lower 2013-10-19 22:00:17 +01:00
Miek Gieben 949e660b37 Better comments 2013-10-19 11:44:13 +01:00
Miek Gieben 3b832a072a Add TODO 2013-10-19 11:10:51 +01:00
Miek Gieben 08578961f5 Add a limit after which the connection is closed 2013-10-19 10:18:20 +01:00
Miek Gieben 5eca59c9e7 Correctly implement multiple queries over 1 tcp conn.
Completely transparant give users another query to handle.
2013-10-18 23:06:28 +01:00
Miek Gieben ed0b128bd2 Add some groundwork for implementing rfc5966 recommendations 2013-10-18 11:59:19 +00:00
Miek Gieben 5e674212d0 Nobody uses these author/version handlers, kill them 2013-10-17 20:23:30 +01:00
Miek Gieben 145242b519 Cleanup the defer from serve()
Close the connection when returning.
2013-10-16 21:45:29 +01:00
Miek Gieben 075c815ff1 Fix udp handling
Make the Close() for the udp message a nop, as closing it would
close the udp listener.
Make the serve function simpler as this does not need to be in a
for-loop.
2013-10-16 21:38:11 +01:00
Miek Gieben 104d9bf0ba remove mutex here 2013-10-15 20:44:55 +01:00
Miek Gieben 68083bc956 Fix merge conflict from net branch 2013-10-12 17:59:46 +01:00
Eric Gavaletz 41945815b8 Further patching for GAE compatibility.
Since net.ListenTCP, net.ListenUDP and net.TCPListener are not defined
in the GAE standard library these build flags will stop those files from
being imported.  A better solution would have been to break up this
monolithic package into smaller parts.
2013-10-02 11:50:35 -04:00
Miek Gieben 9a38f97391 Fix timeouts, Tsig and EDNS0 update size 2013-09-29 11:21:18 +01:00
Miek Gieben 2b6e9122bd Use the better name: SingleInflight 2013-09-06 09:49:07 +00:00
Miek Gieben ac0703bbe6 Handle MixCase queries again.
Thanks Ask for reporting.
2013-07-25 08:32:10 +01:00
Miek Gieben baa7ca4a82 Fix as212 server 2013-06-22 21:40:19 +01:00
Miek Gieben 5f6228d4cc Use the non-exported version err 2013-06-20 07:27:28 +01:00
Miek Gieben 5d094e6e2d gofmt 2013-06-14 19:42:55 +01:00
Miek Gieben 72f4cd81d8 Rename these internal values
_UDP and _TCP are ugly, just lowercase them.
2013-05-13 12:02:29 +02:00
Miek Gieben 5537ac771d Recheck the server mux match logic
And a test to make sure it all works. The root zone can still
be configured as a last resort (wildcard) match.
2013-05-12 15:56:12 +02:00
Miek Gieben d53d9eab81 gofmt 2013-05-05 20:30:44 +02:00