Commit Graph

8 Commits

Author SHA1 Message Date
Miek Gieben cfe41281c2
txt parser: fix goroutine leak (#570)
* txt parser: fix goroutine leak

When a higher level (grammar or syntax) error was encountered the lower
level zlexer routine would be left open and trying to send more tokens
on the channel c. This leaks a goroutine, per failed parse...

This PR fixes this by signalling this error - by canceling a context -
retrieving any remaining items from the channel, so zlexer can return.

It also adds a goroutine leak test that can be re-used in other tests,
the TestParseBadNAPTR test uses this leak detector.

The private key parsing code had the same bug and is also fixed in this
PR.

Fixes #586
Fixes https://github.com/coredns/coredns/issues/1233

* sem not needed anymore
2017-11-17 10:47:28 +00:00
Miek Gieben 0aa3021a83 Remove all copyright notices
Use the central COPYRIGHT file.
2014-09-11 20:57:37 +01:00
Miek Gieben 81941d4422 Update all copyright notices 2013-05-12 16:15:52 +02:00
Miek Gieben 5a3db7b240 delayed newline counting
Fix a lot of corning cases for correct newline counting, but not
the ones where the closing brace is solely on a newline.
2012-11-21 22:21:40 +01:00
Miek Gieben c15d4fe3a3 Ugly hack to get line count correct
When the parser has read a \n to error messsage is off-by-one.
This fixes that.
2012-11-21 17:19:16 +01:00
Miek Gieben bad984954b go fmt and line nr tweak 2012-02-21 22:43:24 +01:00
Miek Gieben f9d3068eb9 Parsing speed increase of facter 2/3
Implemented my own little tokenizer in scanner.go. I only use the
stuff I need.
2012-02-21 22:41:00 +01:00
Miek Gieben f8fb563af9 Added simple scanner impl. 2012-02-21 22:36:27 +01:00