fix an issue where twisted's code raises a ValueError on bad data
fix an issue where twisted's code raises a ValueError on bad data

A malformed user message can result in this:

ERROR:twisted:Unhandled Error
Traceback (most recent call last):
  File "/var/env/txircd/lib/python2.7/site-packages/twisted/python/log.py", line 88, in callWithLogger
    return callWithContext({"system": lp}, func, *args, **kw)
  File "/var/env/txircd/lib/python2.7/site-packages/twisted/python/log.py", line 73, in callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "/var/env/txircd/lib/python2.7/site-packages/twisted/python/context.py", line 118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/var/env/txircd/lib/python2.7/site-packages/twisted/python/context.py", line 81, in callWithContext
    return func(*args,**kw)
--- <exception caught here> ---
  File "/var/env/txircd/lib/python2.7/site-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
    why = selectable.doRead()
  File "/var/env/txircd/lib/python2.7/site-packages/twisted/internet/tcp.py", line 215, in doRead
    return self._dataReceived(data)
  File "/var/env/txircd/lib/python2.7/site-packages/twisted/internet/tcp.py", line 221, in _dataReceived
    rval = self.protocol.dataReceived(data)
  File "/var/env/txircd/txircd/txircd/user.py", line 67, in dataReceived
    irc.IRC.dataReceived(self, data)
  File "/var/env/txircd/lib/python2.7/site-packages/twisted/words/protocols/irc.py", line 305, in dataReceived
    prefix, command, params = parsemsg(line)
  File "/var/env/txircd/lib/python2.7/site-packages/twisted/words/protocols/irc.py", line 83, in parsemsg
    prefix, s = s[1:].split(' ', 1)
exceptions.ValueError: need more than 1 value to unpack

We have no choice but to catch errors out of dataReceived() and treat them as connection errors.

Heufneutje/txircd,ElementalAlchemist/txircd