Commit Graph

2885 Commits

Author SHA1 Message Date
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 fcbb2e7a9a Check and better errors 2014-04-08 00:09:26 +01:00
Miek Gieben 8f8b675103 Add better parsing test 2014-04-06 09:29:42 +01:00
Miek Gieben abe6de223d Add some more checks 2014-04-05 08:06:49 +01:00
Miek Gieben a211645d0a Also check for msg length 2014-04-04 19:43:39 +01:00
Miek Gieben 3b785244ab Add test for parsing a packet 2014-04-04 19:33:50 +01:00
Miek Gieben 7ebb4c59b3 Update the list of CONTRIBUTORS 2014-03-02 17:00:58 +00:00
Miek Gieben 7aaa2f5a4f Merge branch 'master' of github.com:miekg/dns 2014-03-02 16:48:55 +00:00
Miek Gieben 541776149c Merge pull request #85 from andrewtj/atj-encoding
Parsing and Stringer Changes
2014-03-02 16:48:46 +00:00
Miek Gieben 28a65aaf87 test: enable txt equal test
This test fails, but stops failing when I merge pull request #85.
2014-03-02 16:47:52 +00:00
Andrew Tunnell-Jones bd189318ed Document domain name and TXT escaping behaviour 2014-03-02 10:38:46 +00:00
Andrew Tunnell-Jones 588a52762d Test byte escaping in Domain Names and TXT strings
TestTXTRRQuick may not always cover these bytes so explicitly test that
they're covered.
2014-03-02 10:37:07 +00:00
Andrew Tunnell-Jones 22f3256df4 Bump up MaxCountScale in TestTXTRRQuick
Increases number of test iterations which should cover more corner-cases.
2014-03-02 10:15:26 +00:00
Andrew Tunnell-Jones 0a5cb5c80a Update TSIG doc header to avoid godoc oddity
For some reason godoc treats it as plain text because it contains
"(TSIG)".
2014-03-02 09:48:46 +00:00
Andrew Tunnell-Jones 38d78bafe4 Escape @ when printing/unpacking domain names 2014-03-01 22:30:52 +00:00
Andrew Tunnell-Jones 3ba746b6ca Convention is Txt not TXT in msg.go function names 2014-03-01 22:25:24 +00:00
Miek Gieben 2ea84f6110 Add test for upcoming txt changes 2014-03-01 07:34:44 +00:00
Andrew Tunnell-Jones 6fd4d29ced Fix bounds overflow in sprintTxt
Passing excessively long strings (>256*4+3) to sprintTxt would result in
overflowing src. Fix isn't as efficient but simplifies the code.
2014-03-01 02:42:47 +00:00
Andrew Tunnell-Jones 0c98da613d Fix bounds check in nextByte 2014-03-01 02:37:24 +00:00
Miek Gieben 6f477021c0 Make race detector not fire on this simple test
Do the standard Lock()/modify/Unlock() dance.
2014-02-28 15:57:10 +00:00
Miek Gieben 45c5ad39c5 Merge pull request #87 from majek/marek/copy_malloc
Reduce memory allocations in msg.Copy()
2014-02-28 14:52:44 +00:00
Marek Majkowski 999a3ce301 Reduce number of memory allocations in msg.Copy
Right now we allocate memory even for empty slices. This is inefficient, sticking "nil" as a slice is good enough if there are no items.
2014-02-28 07:03:21 -08:00
Andrew Tunnell-Jones 3f834a04fb Update domain name and TXT string escape behaviour
Changes to domain name packing and unpacking:
* Escape dot, backslash, brackets, double-quote, semi-colon and space
* Tab, line feed and carriage return become \t, \n and \r

Changes to TXT string packing and unpacking:
* Escape backslash and double-quote
* Tab, line feed and carriage return become \t, \n and \r
* Other unprintables to \DDD

Stringers do the equivalent of putting domain names and TXT strings
to the wire and back.

There is some duplication of logic. I found performance suffered when
I broke the logic out into smaller functions. I think this may have
been due to functions not being inlined for various reasons.
2014-02-26 10:55:11 +00:00
Andrew Tunnell-Jones f6d8a66c01 Add quick tests for domain name and TXT rr 2014-02-26 10:52:48 +00:00
Miek Gieben 6d77efff22 Merge pull request #86 from andrewtj/atj-hipfix
Fix HIP record unpacking
2014-02-22 08:16:55 +00:00
Andrew Tunnell-Jones c500de0e7a Fix HIP record unpacking
* limit decoding of Hit to HitLength
* limit decoding of PublicKey to PublicKeyLength
* limit decoding of RendezvousServers to rdata's length
2014-02-22 05:28:48 +00:00
Miek Gieben 979b2ea731 Merge pull request #84 from andrewtj/atj-escape
Fix packing label ending in escaped dot
2014-02-15 08:06:09 +00:00
Miek Gieben 09b05ded46 Remove external DNS dependency
This makes the test run 10x faster and does not require internet
access for running the tests.
2014-02-15 08:03:40 +00:00
Andrew Tunnell-Jones 4bf3023c78 Handle label ending in an escaped dot in PackDomain 2014-02-15 00:40:53 +00:00
Andrew Tunnell-Jones 158454ada4 Test packing label ending in escaped dot 2014-02-15 00:37:57 +00:00
Miek Gieben 0258525f20 Comment tweak 2014-02-14 22:47:53 +00:00
Miek Gieben e81b46d580 Add client.UDPsize
This allows a client to set a default UDPSize with resorting to EDNS0
headers 'n stuff.
2014-02-14 22:14:41 +00:00
Miek Gieben 3fca11e695 Add test to see that udp client is too large 2014-02-14 21:53:00 +00:00
Miek Gieben 87b380cad5 Revert "Use dLen for domain name length"
This reverts commit b595183834.

Fix up the tests too.
2014-02-14 20:20:22 +00:00
Miek Gieben 83efab6078 Revert "Use dLen in TSIG too"
This reverts commit 37406413d7.
2014-02-14 20:05:51 +00:00
Miek Gieben c46b0e07c3 Normalize names a bit 2014-02-12 13:36:04 +00:00
Miek Gieben 89cc033428 Be much more precice in msg.Len()
There is still a one-off in EDNS0 records, but I'm not too bothered with
that one.
2014-02-12 12:59:42 +00:00
Miek Gieben 37406413d7 Use dLen in TSIG too 2014-02-12 12:51:13 +00:00
Miek Gieben b595183834 Use dLen for domain name length 2014-02-12 12:50:16 +00:00
Miek Gieben 31102c38b7 Make Len() much more accurate for compressed messages.
Lots of changes made and bugs fixed.
2014-02-11 23:01:47 +00:00
Miek Gieben 9dcccf22da Fold TODO in README.md 2014-02-10 20:42:52 +00:00
Miek Gieben d0fa099d08 Document and disable the test 2014-02-10 20:28:17 +00:00
Miek Gieben d24565edc8 Merge branch 'len'
Cleanup the rest and add the test.
2014-02-10 20:20:08 +00:00
Miek Gieben 21283d2192 Improve msg.Len() accuracy
Currently msg.Len() overshoots a _lot_ when compression is
enabled. The main problem is that once a part of a domain is found to
be compressed, the whole domain is _not_ added back to compression
dictionary.

That means if we once cache ".microsoft.com" we won't cache
"blah.microsoft.com".

Ammended a bit: put the test in dns_test.go
2014-02-10 20:16:05 +00:00
Miek Gieben dcb0117c0a add AUTHOR file
Cleanup the other files a bit.
2014-02-10 17:15:49 +00:00
Miek Gieben 8f334b52a0 Merge branch 'master' of github.com:miekg/dns 2014-02-10 15:31:20 +00:00
Miek Gieben 6293844a72 Check compression lengths 2014-02-10 12:43:38 +00:00
Miek Gieben 0cba5240c3 More tests lenght 2014-02-10 12:43:09 +00:00
Miek Gieben 372e3d55c3 More tests lenght 2014-02-10 12:29:33 +00:00
Miek Gieben 56e0bb46d8 Remove packLen() and fix bug in Len()
packLen() was a featureless mirror of Len(). Remove it, and just use
Len() internally too.
Fix bug in Len() too, where the length of the additional section was
not counted.
2014-02-10 12:23:53 +00:00