On the one hand, the complex ragel solution is explicit about the config syntax
and requires little heavy lifting on the Go side, but the ragel definition is
overly complex, too rigid and produces bloody huge binary output. On the other
the simple ragel solution can provide pretty much the same syntax with some
type conversion, but the reflection magic to pack this into objects correctly
is done much better by the JSON module. Forcing parsing of everything tostrings
results in lots of nasty if/case statements in the Go code.
JSON has another benefit in that the config serialisation is two-way, allowing
for web or IRC based configuration. It's a pity it's a bugger to edit by hand.
This reverts commit 7515f11470.
This doesn't use the "default" CAs, it explicitly turns off CA verification.
Probably not the best of ideas. Patch to enable optional verification coming.
Conflicts:
irc/connection.go
* due to the blocking nature of channel reads, by the time the runLoop()
for loop exits in that goroutine, we might well be half-way through
reconnecting to the server -- a bad time to run conn.initialise().
move the call to initialise() into shutdown() to ensure it happens
in a timely manner.
* On a related note, conn.Me was retaining old channel objects in it's
Channels map. All other references to nicks and channels are erased
in conn.initialise(), but as we keep a seperate reference to our Nick
object in conn.Me, we need to reinit that at the same time.
* sending NICK after 433 -- but before 001 from server -- does not
result in a confirmation NICK message back from server, so we need
to change Conn.Me.Nick in the 433 handler in this case.
* Nick MODE changes are transmitted back to us in line.Text not
line.Args[1], so make sure error messages use this when needed.
Send a single WHO on joining channel rather than triggering a WHOIS of
every nick in the 353 RPL_NAMES handler. Avoids 'Excess Flood' when
joining a large channel ;-)
add simple test code to make building this package within src/pkg happy;
update irc/Makefile whitespace -- s/ /\t/;
update .gitignore to ignore _test directory created in test build;