]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Improve AMI long line error handling
authorDavid M. Lee <dlee@digium.com>
Fri, 5 Oct 2012 20:14:41 +0000 (20:14 +0000)
committerDavid M. Lee <dlee@digium.com>
Fri, 5 Oct 2012 20:14:41 +0000 (20:14 +0000)
commit8451fec7ec713013b848a5587bf58cb16fb87ae8
treed0ec74a02f2d6835a523381e0333660965171fa5
parente9a0f5a4e333b059e4f0740a5f2e6840d601e2cf
Improve AMI long line error handling

In AMI's parser, when it receives a long line (> 1024 characters), it discards
that line, but continues to process the message normally.

Typically, this is not a problem because a) who has lines that long and b)
usually a discarded line results in an invalid message. But if that line is
specifying an optional field, then the message will be processed, you get a
'Response: Success', but things don't work the way you expected them to.

This patch changes the behavior when a line-too-long parse error occurs.

* Changes the log message to avoid way-too-long (and truncated anyways) log
  messages
* Adds a 'parsing' status flag to Response: Success
* Sets parsing = MESSAGE_LINE_TOO_LONG if, well, a line is too long
* Responds with an appropriate error if parsing != MESSAGE_OKAY

(closes issue AST-961)
Reported by: John Bigelow
Review: https://reviewboard.asterisk.org/r/2142/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@374570 65c4cc65-6c06-0410-ace0-fbb531ad65f3
main/manager.c