changeset 330:e283e18b2673

Removed incorrect ASSERT -- thanks to Alexandre for the bug finding.
author Sebastien Decugis <sdecugis@nict.go.jp>
date Mon, 31 May 2010 10:33:59 +0900
parents b8f85559ba04
children ac6e9cc9c3ba
files libfreeDiameter/messages.c
diffstat 1 files changed, 13 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/libfreeDiameter/messages.c	Fri May 28 17:49:28 2010 +0900
+++ b/libfreeDiameter/messages.c	Mon May 31 10:33:59 2010 +0900
@@ -2211,25 +2211,23 @@
 	while (avp != NULL) {
 		/* For unknown AVP, we don't have a callback registered, so just skip */
 		if (avp->avp_model) {
-			struct dict_object * type, * enumval;
+			struct dict_object * enumval = NULL;
 			
-			/* Sanity */
-			ASSERT( avp->avp_public.avp_value );
-
 			/* Get the list of callback for this AVP */
 			CHECK_FCT_DO( ret = fd_dict_disp_cb(DICT_AVP, avp->avp_model, &cb_list), goto error );
 			
-			/* Check if the AVP has a constant value */
-			CHECK_FCT_DO( ret = fd_dict_search(dict, DICT_TYPE, TYPE_OF_AVP, avp->avp_model, &type, 0), goto error );
-			if (type) {
-				struct dict_enumval_request req;
-				memset(&req, 0, sizeof(struct dict_enumval_request));
-				req.type_obj = type;
-				memcpy( &req.search.enum_value, avp->avp_public.avp_value, sizeof(union avp_value) );
-				CHECK_FCT_DO( ret = fd_dict_search(dict, DICT_ENUMVAL, ENUMVAL_BY_STRUCT, &req, &enumval, 0), goto error );
-			} else {
-				/* No enumerated value in this case */
-				enumval = NULL;
+			/* We search enumerated values only in case of non-grouped AVP */
+			if ( avp->avp_public.avp_value ) {
+				struct dict_object * type;
+				/* Check if the AVP has a constant value */
+				CHECK_FCT_DO( ret = fd_dict_search(dict, DICT_TYPE, TYPE_OF_AVP, avp->avp_model, &type, 0), goto error );
+				if (type) {
+					struct dict_enumval_request req;
+					memset(&req, 0, sizeof(struct dict_enumval_request));
+					req.type_obj = type;
+					memcpy( &req.search.enum_value, avp->avp_public.avp_value, sizeof(union avp_value) );
+					CHECK_FCT_DO( ret = fd_dict_search(dict, DICT_ENUMVAL, ENUMVAL_BY_STRUCT, &req, &enumval, 0), goto error );
+				}
 			}
 			
 			/* Call the callbacks */
"Welcome to our mercurial repository"