Mercurial > hg > waaad
changeset 298:61671fe54fe3
Fixed ABNF definition for messages with 'E' flag
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Wed, 07 Jan 2009 11:47:29 +0900 |
parents | a3e7032becb1 |
children | 4e3ad81a06df |
files | waaad/message.c |
diffstat | 1 files changed, 13 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/waaad/message.c Wed Jan 07 11:47:06 2009 +0900 +++ b/waaad/message.c Wed Jan 07 11:47:29 2009 +0900 @@ -1259,10 +1259,18 @@ /* First, handle the cases where there is no model */ { - /* Commands MUST be supported in the dictionary */ - if (CHECK_MSG(object) && ((model = _M(object)->msg_model) == NULL)) { - TRACE_DEBUG(INFO, "Message with no dictionary model. EBADMSG"); - return EBADMSG; + if (CHECK_MSG(object)) { + if ( _M(object)->msg_public.msg_flags & CMD_FLAG_ERROR ) { + /* The case of error messages: the ABNF is different */ + model = dict_cmd_error; + } else { + model = _M(object)->msg_model; + } + /* Commands MUST be supported in the dictionary */ + if (model == NULL) { + TRACE_DEBUG(INFO, "Message with no dictionary model. EBADMSG"); + return EBADMSG; + } } /* AVP with the 'M' flag must also be recognized in the dictionary -- except inside an optional grouped AVP */ @@ -1302,7 +1310,7 @@ CHECK_FCT( _mpr_do ( _C(ch->o), rule, is_child_mand ) ); } } - + /* Now check all rules of this object */ data.sentinel = &_C(object)->children; data.ruleavp = NULL;