Commit Graph

2886 Commits

Author SHA1 Message Date
Miek Gieben ce360dab57 fmt 2014-01-12 10:22:04 +00:00
Miek Gieben 00a08d77fc PackBuffer: slight cleanup in docs 2014-01-12 10:21:23 +00:00
Miek Gieben 7f8964662e Merge branch 'majek/packwithbuffer' of https://github.com/majek/dns into bufpack 2014-01-12 10:17:35 +00:00
Miek Gieben be9467466c Formatting and reshuffle some code 2014-01-12 10:11:23 +00:00
Miek Gieben 3342ee9d85 Rename dupIP to copyIP
Also make the function shorter.
2014-01-12 10:09:54 +00:00
Miek Gieben a56060b558 Cleanups for Copy()
Docs and slight code formatting issues.
2014-01-12 10:04:38 +00:00
Miek Gieben 189f4a23fc Merge pull request #74 from majek/marek/deepcopy
msg.Copy() makes a deep-copy of the msg object
2014-01-12 02:03:17 -08:00
Miek Gieben 82b2b6ec82 QuoteToASCII is needed
When not using this, TXT strings get interpreted by Golang, making
TXT behave unexpected. QuoteToASCII has surpises too, see
TestTxtEqual(), but this, I hope, lesser of an issue.
2014-01-11 17:17:38 +00:00
Miek Gieben a49cd38336 Add quoteString function.
This is to just quote a string s -> "s"
2014-01-11 16:57:36 +00:00
Miek Gieben 3bd18e9a56 add test for matching text records 2014-01-11 16:32:08 +00:00
Miek Gieben ef732d1050 RRSIGs: parse epoch timestamp too
According to RFC4034 the timestamp in RRSIG may also be an EPOCH.
Check for this when parsing. Knot DNS zone dumps contain timestamp
RRSIG, this makes those parseable by Go DNS.
2014-01-11 08:50:10 +00:00
Miek Gieben c174304212 Add test for RRSIG with timestamp in epoch
This is standard's compliant but currently not supported.
2014-01-11 08:37:34 +00:00
Miek Gieben f3af5834c2 Also add empty txt record in another test 2014-01-11 08:12:13 +00:00
Miek Gieben e64ea20885 Merge pull request #75 from andrewtj/atj-txtparsefix
Fix parsing TXT records containing empty strings
2014-01-11 00:07:07 -08:00
Andrew Tunnell-Jones 549ed97be1 Fix parsing of TXT records containing empty-strings 2014-01-11 05:33:23 +00:00
Andrew Tunnell-Jones 938210c3ad Test parsing of TXT records containing empty-strings 2014-01-11 05:31:43 +00:00
Andrew Tunnell-Jones 91f31a2b71 Define length in multi-entry TXT parse length test in terms of header + rrdata 2014-01-11 05:30:46 +00:00
Andrew Tunnell-Jones 4584fc0cb3 Fix single-entry TXT parse length test 2014-01-11 05:28:47 +00:00
Marek Majkowski 2cfad667d7 msg.Copy() makes a deep-copy of the msg object
There was a copy function that did shallow copies of the msg
object. Export it and make it support proper deep copying.
2014-01-10 08:49:45 -08:00
Marek Majkowski d18d87b37d Introduce msg.PackBuffer() - it's like msg.Pack() but can reuse a byte buffer
msg.Pack() always allocates a byte slice. This is good for simplicity,
but in a serious application it's preferable to reuse byte slices to
reduce the GC overhead. This patch introduces a new public method:
PackBuffer(). It's exaclty like Pack() but is able to reuse a
given byte slice. It will still allocate a new slice if the given one
is too small.
2014-01-10 07:46:24 -08:00
Miek Gieben a627d88e3f Remove stale comments 2014-01-08 10:11:19 +00:00
Miek Gieben 52f9a59ac1 Cleanup singleFlight a bit 2014-01-08 10:10:39 +00:00
Miek Gieben e79b53886c Correct doc 2014-01-07 11:45:40 +00:00
Miek Gieben 1b53a55801 Add todo 2014-01-07 11:17:01 +00:00
Miek Gieben 8e37d3660d Merge branch 'master' of github.com:miekg/dns 2014-01-07 07:45:29 +00:00
Miek Gieben 9f5db7b72c Disable the unfinished CAA support
CAA was partially implemented, it's better to do it 100% until that
time handle CAA as an unknown record.

Closes #70:
2014-01-07 07:44:06 +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 86f8bc9fff Merge branch 'master' of github.com:miekg/dns 2014-01-05 20:41:52 +00:00
Miek Gieben d2977942a4 Merge pull request #69 from millerkil/setrcode-refactor
Refactor SetRcode, rd bit is now set properly for error packets
2014-01-05 12:41:43 -08:00
Alex Ciuba 848a6c7268 Refactor SetRcode, rd bit is now set properly for error packets 2014-01-05 15:20:41 -05: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 18e84f97d1 make the channel size larger 2014-01-05 14:06:07 +00:00
Miek Gieben e6da4dbeab Make the channels buffered 2014-01-05 13:55:58 +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 7a27e05cb7 Remove setting compress to nil
Useless operation as compress is already nil from the
initialization.
2014-01-05 08:06:29 +00:00
Miek Gieben c17b6e8905 Merge pull request #68 from soh335/fix/empty-txt
if txt rdlength is 0, not read anymore
2014-01-04 06:41:58 -08:00
Miek Gieben e01f57407d Put all len() function on one line
At least for the shorter ones.
2014-01-04 13:05:57 +00:00
Miek Gieben bca469e6b1 Fix other string len occurences
Add the +1 in the correct places for the RR length calculations.
2014-01-04 12:50:18 +00:00
Miek Gieben 5b8a651bf0 Fix typo in comment 2014-01-04 11:53:50 +00:00
Miek Gieben 43daccf863 remove println 2014-01-04 11:33:10 +00:00
Miek Gieben 9e73cb688f Fix NAPTR's length function
Add the 3 bytes for the length byte of the strings.

Close issue #67.
2014-01-04 11:30:20 +00:00
Miek Gieben f094f37de3 Add shortbuf erorr too
Cleanup the pull request a bit.
2014-01-04 11:17:13 +00:00
soh335 e8a5f90957 if txt rdlength is 0, not read anymore 2014-01-04 17:30:08 +09:00
Miek Gieben b1f108f79c Simplify client TCP write.
Use the same patch as in the server.
2014-01-04 08:30:08 +00:00
Miek Gieben 39ef03c034 Merge pull request #66 from armon/patch-1
Simplify the Write() for TCP based connections
2014-01-04 00:18:22 -08:00