Commit Graph

283 Commits

Author SHA1 Message Date
Miek Gieben
97603e3f62 Readd ExchangeConn 2013-10-12 12:35:09 +01:00
Miek Gieben
77d78f3218 More xfr fixes, does not work yet 2013-10-11 22:34:04 +01:00
Miek Gieben
ca3c488ad8 Fix transfer 2013-10-11 16:36:37 +00:00
Miek Gieben
b987dc6246 More transfer stuff 2013-10-11 16:18:37 +00:00
Miek Gieben
403baeb73a Rework the transfers stuff 2013-10-02 20:35:13 +01:00
Eric Gavaletz
7f3472cc74 Patching to make compatible with appengine/socket.
The interface conversion from socket.Conn to net.UDPConn fails, but
since you can use a generic Read(b) in place of ReadFromUDP(b) it makes
sense to git rid of the conversion to net.UDPConn.  This change allows
the use of the client library for UDP DNS lookup using the
appengine/socket package's Conn.

For the same reasons the interface conversions for TCP connections were
also removed.
2013-10-02 11:41:26 -04:00
Miek Gieben
db3de29edc doc updates 2013-09-29 20:30:04 +01:00
Miek Gieben
b02f1b5203 Add Timeouts back in.
Fix the timeouts
2013-09-29 11:46:39 +01:00
Miek Gieben
500a32e64f Update all the tests 2013-09-29 11:26:02 +01:00
Miek Gieben
9a38f97391 Fix timeouts, Tsig and EDNS0 update size 2013-09-29 11:21:18 +01:00
Miek Gieben
b97b3340fb Make TSIG work again
Start fixing and using the UDP bufsize option.
2013-09-29 10:22:27 +01:00
Miek Gieben
4bde528be5 Export dns.Conn and make it more like net.Conn
Export lowlevel function and types so that they may be used.
They higher level Exchange function is still there. ExchangeConn
is gone, because it is not needed.
2013-09-28 21:58:08 +01:00
Miek Gieben
22977491c3 Try to use Conn 2013-09-28 20:31:29 +01:00
Miek Gieben
2b6e9122bd Use the better name: SingleInflight 2013-09-06 09:49:07 +00:00
Miek Gieben
bb71be0271 Implement outstanding query detection.
Copied from the standard library and adapted to Go DNS.
2013-08-24 02:28:58 +00:00
Miek Gieben
d117fda34b Perform query inflight deduplication
Taking a queue from Go tip, I copied over the new code and tweaked
it a bit for use in Go DNS.
2013-08-23 22:56:34 +00:00
Miek Gieben
3457c0428d Some work in outstanding query de-deplication 2013-08-23 20:29:52 +00:00
Miek Gieben
11d592bfa7 client.Retry does not do anything
Remove from the struct as it was not implemented.
2013-06-15 20:35:09 +01:00
Miek Gieben
f595bf7a06 Set license on test files 2013-05-12 16:09:52 +02:00
Miek Gieben
19d93e2181 Fix it 2013-01-28 21:49:23 +01:00
Miek Gieben
6dfe504a09 small cleanups 2013-01-28 20:41:17 +01:00
Miek Gieben
73b9284ec7 remove dead code 2013-01-28 20:40:41 +01:00
Miek Gieben
23483f7959 Make it compile 2013-01-28 20:32:36 +01:00
Miek Gieben
0dc922a99b Add a ExchangeConn 2013-01-28 20:30:13 +01:00
Miek Gieben
c8f880217f Close the connection
Patch from: Alex Sergeyev
2013-01-28 19:27:24 +01:00
Miek Gieben
4ba5ac6863 Remove client.Attempts
Didn't like it anyway and it made the calling logic a mess. So it is
now removed. Failed queries can be redone, but they should be initiated
from the client, not within the library.
2013-01-11 19:20:49 +01:00
Miek Gieben
e66c2a1324 m.Size isnt used 2012-12-14 13:33:24 +01:00
Miek Gieben
3609f3e7a5 gofmt -s 2012-12-09 19:07:31 +01:00
Miek Gieben
d758825590 more documentation 2012-12-02 10:14:53 +01:00
Miek Gieben
1297852fdc Fix tcp read/writes and client.Attempts
Thanks to a bug report from Vitalie Cherpec which commented that this
didn't work.

The timeout settings we not in the client.attempts loop, so they
were only active for the first attempt. And the loop wasn't broken
out of when the write or read succeeded.

Both these issues are now fixed.
2012-11-22 15:06:21 +01:00
Miek Gieben
c7ad10314a Remove the Do function -- easy to do in standard Go 2012-11-19 18:14:09 +01:00
Miek Gieben
33e3a5396e Dont even bother do allocate a channel 2012-11-19 16:55:14 +01:00
Miek Gieben
e2ca025569 update documentation 2012-11-19 16:22:54 +01:00
Miek Gieben
5349c3532f Per suggestion of Jan Mercle 2012-11-19 14:43:02 +01:00
Miek Gieben
a0b6e30da7 Fix chaos.go for the new api 2012-11-18 13:51:42 +01:00
Miek Gieben
553b780257 Rearrange some comments 2012-11-18 13:28:16 +01:00
Miek Gieben
b34501bc1a add remark 2012-11-18 13:12:11 +01:00
Miek Gieben
cbf025827a Fix the documentation 2012-11-18 13:03:11 +01:00
Miek Gieben
ccaa90b31e Make client.Do() return a channel (ala time.NewTicker)
This new API finally makes sense, and ditches the callback
2012-11-18 12:50:22 +01:00
Miek Gieben
099d0c1fc7 Add exchange structure for the client 2012-11-18 12:33:56 +01:00
Miek Gieben
3c3d2af072 Remove the Rtt variants 2012-11-18 12:29:40 +01:00
Miek Gieben
ea947838d8 Do the TCP write in one write
Before the tcp writes were done like NSD does them:
2 bytes length, and the rest of the message.

Now a complete buffer is created with LLMMM...MMM, where
LL is the 2 byte length and MMM...MMM is the message to be send.
This makes the reply faster at the cost of doing a realloc of the
message buffer.
2012-10-17 12:40:57 +02:00
Miek Gieben
1cca340f0b Use attemps also in the dial function 2012-10-17 09:05:26 +02:00
Miek Gieben
bf1e1e15dc docs 2012-10-16 19:14:03 +02:00
Miek Gieben
56221057d3 exchangeBuffer was and is not needed 2012-10-16 13:18:59 +02:00
Miek Gieben
be0423d80f Tsig for queries is working again 2012-10-16 09:42:38 +02:00
Miek Gieben
2d3630ac98 refacter the client code a bit and remove the duplicate code 2012-10-16 09:36:52 +02:00
Miek Gieben
3089111fa4 calculate tsig in the normal query path too 2012-10-16 08:50:53 +02:00
Miek Gieben
39b9f93167 Fix tsig in the normal sending of queries 2012-10-15 20:00:49 +02:00
Miek Gieben
570bf8dc69 Use proper error in packing and unpacking
All the relevant functions now return an error instead of
a simple boolean. This greatly approves the feedback to coders.

Spotted some fishy error handling along the way and fix that too.
2012-10-09 21:17:54 +02:00
Miek Gieben
6e9317868b doc tweaks 2012-09-01 17:06:24 +02:00
Miek Gieben
ff946625a6 small tweaks 2012-09-01 16:57:15 +02:00
Miek Gieben
7a0877d090 Merge conflict fixed 2012-08-31 15:10:43 +02:00
Miek Gieben
90a2076d8d We were dialing twice 2012-08-31 14:55:47 +02:00
Miek Gieben
9255ad61ac outgoing xfr works, but not for my Go code 2012-08-28 21:36:25 +02:00
Miek Gieben
68961f2f5b Make the IsTsig and IsEdn0 more usefull by returning the record 2012-08-25 11:24:01 +02:00
Miek Gieben
15f03a72fb Not needed 2012-08-23 10:33:33 +02:00
Miek Gieben
a8b3c8139b Clean up the client 2012-08-17 08:45:26 +02:00
Miek Gieben
b720003623 make api smaller 2012-08-17 08:31:38 +02:00
Miek Gieben
1958fd2031 Fix compile errors 2012-08-08 09:45:31 +02:00
Miek Gieben
a282683f7c Add DoRtt 2012-08-08 09:38:23 +02:00
Miek Gieben
37ff3f9f84 Add DROP and READXFR 2012-08-07 12:33:31 +02:00
Miek Gieben
cf84dce538 Update the todo 2012-08-06 20:39:35 +02:00
Miek Gieben
eec679d102 Remove hijacked 2012-08-06 20:34:09 +02:00
Miek Gieben
9ac8d2d7de RequestWriter can go too 2012-08-06 20:09:45 +02:00
Miek Gieben
7de64f0dda remove all the async query stuff in favor of the new Do() 2012-08-06 20:08:48 +02:00
Miek Gieben
f090b34c40 Use the new api - now on to fixing Tsig 2012-08-06 20:03:46 +02:00
Miek Gieben
e628564f33 Fix attempts in the client 2012-08-05 18:36:36 +02:00
Miek Gieben
51e13a15c9 snapshot 2012-08-05 18:13:23 +02:00
Miek Gieben
a113c7acd8 bug fix 2012-07-05 15:37:06 +02:00
Miek Gieben
6930a3a307 Tweaks for get a secure lookup going 2012-06-05 09:31:50 +02:00
Miek Gieben
53b065793b More preparation for the root 2012-06-03 09:35:39 +02:00
Miek Gieben
bb376b18b3 Add size received to a pkt 2012-06-01 10:05:27 +02:00
Miek Gieben
530d66a85b Set the channels in Do() 2012-05-26 12:02:37 +02:00
Miek Gieben
9c4c5f5369 remove NewClient from the code 2012-05-26 10:28:32 +02:00
Miek Gieben
458a74b8ce remove the need for NewClient() 2012-05-26 10:24:47 +02:00
Miek Gieben
eb7b7c9745 fix udp/udp4/udp6 2012-05-22 20:15:30 +02:00
Miek Gieben
da983acc37 documentation 2012-05-22 20:14:15 +02:00
Miek Gieben
c84b165dee fix examples 2012-05-22 08:51:30 +02:00
Miek Gieben
f3bb703019 gofmt 2012-05-22 08:48:26 +02:00
Miek Gieben
3e607a3c64 again better naming 2012-05-22 08:47:47 +02:00
Miek Gieben
fac9182aa6 better names 2012-05-21 22:06:58 +02:00
Miek Gieben
06d424549e Make the default async queries more simpler to use
If you don't want to setup your own channels things should
now be simpler. Still the power for eleborate setups is there.
2012-05-21 20:58:41 +02:00
Miek Gieben
37a8bdfec0 use default Incoming channel 2012-05-21 20:18:13 +02:00
Miek Gieben
39bfd06e0f create default reply chan 2012-05-21 19:44:01 +02:00
Miek Gieben
6d9ac0b3de Force v6 or v4 2012-05-21 15:45:26 +02:00
Miek Gieben
4ec99b2dec Fix examples 2012-05-21 14:56:14 +02:00
Miek Gieben
0ff492af57 fix documentation 2012-05-18 19:41:20 +02:00
Miek Gieben
95c1154930 documentation 2012-05-08 14:17:17 +02:00
Miek Gieben
b37c5b4646 more documenation 2012-05-08 14:01:58 +02:00
Miek Gieben
2574856aa6 Add RemoteAddr() to the RequestWriter interface 2012-05-08 13:51:12 +02:00
Miek Gieben
1abdeb80b4 docs 2012-05-07 15:53:35 +02:00
Miek Gieben
3989e8df9c Create a exchangefull 2012-05-07 15:50:13 +02:00
Miek Gieben
fdc0d6924d Documentation 2012-05-05 20:47:23 +02:00
Miek Gieben
c96d86da1f Add remote address too 2012-05-05 17:37:33 +02:00
Miek Gieben
d36ee08216 Fix all the examples 2012-05-05 16:09:57 +02:00
Miek Gieben
86b08d4a0e Slight tweaks 2012-05-05 10:01:56 +02:00
Miek Gieben
ed1c8fa812 Put the rrt info the Exchange struct 2012-05-05 09:56:45 +02:00
Miek Gieben
fc599d23fe Save rtts for clients 2012-05-04 23:18:29 +02:00
Miek Gieben
874787c537 Allow deregistration of handler
Implemented in both the server and client.
Renamed to client function to match the server side functions
Example progs need to be "ported" as this *is* an API change.
2012-03-26 23:15:15 +02:00
Miek Gieben
c53cddf38c TSIG overhauled
This lead to some changes in the Write() function. Both
server side and client side are now more similar.
2012-03-04 21:00:09 +01:00
Miek Gieben
2806def5c0 document the interface better 2012-03-04 14:53:57 +01:00
Miek Gieben
1744a80850 add a TsigStatus to the client as well
Bring server and client side more inline
with each other. For a client we also
use TsigStatus() to retrieve the tsig info.
2012-03-04 14:47:20 +01:00
Miek Gieben
c5465127f3 Fix non tsig queries 2012-03-02 21:19:37 +01:00
Miek Gieben
3232814d1b Fix client side TSIG
Redesign of TSIG. Validation is on the TOOD - this can be
done in the same way as in the server.
2012-03-01 22:40:34 +01:00
Miek Gieben
fd6bdd4bba Elegant Tsig handling in the server
Lowlevel, but flexible. i.e. usable when building a server
2012-02-26 22:38:15 +01:00
Miek Gieben
f7f1d2ab42 Add listenAndServerTsig function 2012-02-26 21:33:50 +01:00
Miek Gieben
485c7e7a41 Fix some outstanding todos 2012-02-25 21:42:08 +01:00
Miek Gieben
93246f458e Fix error handling and TC bit 2012-02-24 23:43:34 +01:00
Miek Gieben
77b60231e7 If we add a dot to a name, be sure to remove one from the length 2012-02-05 11:33:55 +01:00
Miek Gieben
f1542e15d9 use edns0 udpsize in to set the buffer 2012-01-29 00:20:56 +01:00
Miek Gieben
ff55b5253a Updates for the latest weekly: weekly.2012-01-27 2012-01-27 08:39:41 +01:00
Miek Gieben
e6b94db3b2 Just set all the deadlines 2012-01-24 10:06:39 +01:00
Miek Gieben
48d11d3a17 Use Client.Attemps also when reading 2012-01-23 20:35:14 +01:00
Miek Gieben
7b67cbff49 Set the timeouts throughout the code. New Golang api 2012-01-23 20:25:15 +01:00
Miek Gieben
8f66b74c86 2 sec timeout 2012-01-23 11:43:26 +01:00
Miek Gieben
5917838cbb gofmt 2012-01-20 12:24:20 +01:00
Miek Gieben
8c0ecaa61b Fixes for weekly.2012-01-20 2012-01-20 12:13:47 +01:00
Miek Gieben
3cb9591a51 Gofmt 2012-01-15 15:30:12 +01:00
Miek Gieben
95747ee8d1 Some more todo added 2012-01-12 23:28:08 +01:00
Miek Gieben
9b48d4b899 gofmt 2012-01-12 22:49:26 +01:00
Miek Gieben
3078f05f56 Some more memory tweaks 2012-01-12 22:34:53 +01:00
Miek Gieben
2143ce0031 Fix the tests, but they now fail 2012-01-11 14:44:54 +01:00
Miek Gieben
b548a3fe89 Return an error when packing fails 2012-01-08 16:03:30 +01:00
Miek Gieben
d2a064e390 Update in the documentation 2011-12-16 19:35:37 +01:00
Miek Gieben
de3f0f3903 Documentation and make the random better 2011-12-16 19:28:35 +01:00
Miek Gieben
22a467e718 Fixes the latest weekly 2011-11-02 23:06:54 +01:00
Miek Gieben
da2e464de1 A lot of BIND specific checks 2011-09-21 14:22:43 +02:00
Miek Gieben
2f74133d6a More test functions
Minor tweaks for timeouts in client.go
2011-09-20 18:15:36 +02:00
Miek Gieben
956ec9b962 set the timeouts 2011-09-20 17:40:13 +02:00
Miek Gieben
850a12ac8e Return a error when there is no conn, dont panic 2011-09-20 10:20:24 +02:00
Miek Gieben
3be73fcea9 Tsig fixes
make tsig easier to use and even transparant when using the API
2011-09-11 01:10:47 +02:00
Miek Gieben
e4acc12f44 Remove debugging code 2011-09-11 00:32:00 +02:00
Miek Gieben
313640276f Make async querying work again 2011-09-11 00:31:03 +02:00
Miek Gieben
cd17a26192 Give the channels more sane names
Rename ChannelQuery to QueryChan and
ChannelReply to ReplyChan, both sound much better
2011-09-11 00:20:44 +02:00
Miek Gieben
c939840fb2 Fix the examples
Esp. those using xfr functions
2011-09-10 21:37:57 +02:00
Miek Gieben
c9332fad8c remove client.Dial/Close
Was a hack to make qperf faster
2011-09-10 21:12:46 +02:00
Miek Gieben
befa590883 Double check this 2011-09-10 16:59:25 +02:00
Miek Gieben
6e72207318 Simplify tsig
Add a couple of errors, and make the function signature
of the tis function more inline with the dnssec ones.
2011-09-10 16:50:27 +02:00
Miek Gieben
bec4153541 slight updates to the TODO 2011-09-10 14:48:22 +02:00
Miek Gieben
19bf874769 Use a new type to send back request,answer
a type Exchange has been added, which makes communicating with
the resolver more strait forward.

This will also be used in the *xfr functions.
2011-09-10 14:26:08 +02:00
Miek Gieben
41b0b39432 tcp fixes 2011-08-09 15:13:35 +02:00
Miek Gieben
8a82f129c0 tcp fixes 2011-08-09 15:01:29 +02:00
Miek Gieben
44d3cc7daf kill another make() 2011-08-09 13:15:25 +02:00
Miek Gieben
7d2aabea76 re-add qperf 2011-08-08 16:29:13 +02:00
Miek Gieben
861a2adb6c Forget to the add the i := fv.Uint() 2011-08-08 13:10:35 +02:00
Miek Gieben
a44eb54de2 put defer back in 2011-08-04 13:59:15 +02:00
Miek Gieben
1032e7593f defer add a small performance penalty 2011-08-04 13:49:40 +02:00
Miek Gieben
c170e0bbaa Eliminate allocations when using ExchangeBuffer() 2011-08-04 13:17:36 +02:00
Miek Gieben
069c5237f5 added 2011-08-04 11:27:56 +02:00