Mercurial > hg > freeDiameter
comparison libfreeDiameter/messages.c @ 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 | 2d3a799ad29c |
children | ce8d20725308 |
comparison
equal
deleted
inserted
replaced
329:b8f85559ba04 | 330:e283e18b2673 |
---|---|
2209 /* So start browsing the message */ | 2209 /* So start browsing the message */ |
2210 CHECK_FCT_DO( ret = fd_msg_browse( *msg, MSG_BRW_FIRST_CHILD, &avp, NULL ), goto error ); | 2210 CHECK_FCT_DO( ret = fd_msg_browse( *msg, MSG_BRW_FIRST_CHILD, &avp, NULL ), goto error ); |
2211 while (avp != NULL) { | 2211 while (avp != NULL) { |
2212 /* For unknown AVP, we don't have a callback registered, so just skip */ | 2212 /* For unknown AVP, we don't have a callback registered, so just skip */ |
2213 if (avp->avp_model) { | 2213 if (avp->avp_model) { |
2214 struct dict_object * type, * enumval; | 2214 struct dict_object * enumval = NULL; |
2215 | 2215 |
2216 /* Sanity */ | |
2217 ASSERT( avp->avp_public.avp_value ); | |
2218 | |
2219 /* Get the list of callback for this AVP */ | 2216 /* Get the list of callback for this AVP */ |
2220 CHECK_FCT_DO( ret = fd_dict_disp_cb(DICT_AVP, avp->avp_model, &cb_list), goto error ); | 2217 CHECK_FCT_DO( ret = fd_dict_disp_cb(DICT_AVP, avp->avp_model, &cb_list), goto error ); |
2221 | 2218 |
2222 /* Check if the AVP has a constant value */ | 2219 /* We search enumerated values only in case of non-grouped AVP */ |
2223 CHECK_FCT_DO( ret = fd_dict_search(dict, DICT_TYPE, TYPE_OF_AVP, avp->avp_model, &type, 0), goto error ); | 2220 if ( avp->avp_public.avp_value ) { |
2224 if (type) { | 2221 struct dict_object * type; |
2225 struct dict_enumval_request req; | 2222 /* Check if the AVP has a constant value */ |
2226 memset(&req, 0, sizeof(struct dict_enumval_request)); | 2223 CHECK_FCT_DO( ret = fd_dict_search(dict, DICT_TYPE, TYPE_OF_AVP, avp->avp_model, &type, 0), goto error ); |
2227 req.type_obj = type; | 2224 if (type) { |
2228 memcpy( &req.search.enum_value, avp->avp_public.avp_value, sizeof(union avp_value) ); | 2225 struct dict_enumval_request req; |
2229 CHECK_FCT_DO( ret = fd_dict_search(dict, DICT_ENUMVAL, ENUMVAL_BY_STRUCT, &req, &enumval, 0), goto error ); | 2226 memset(&req, 0, sizeof(struct dict_enumval_request)); |
2230 } else { | 2227 req.type_obj = type; |
2231 /* No enumerated value in this case */ | 2228 memcpy( &req.search.enum_value, avp->avp_public.avp_value, sizeof(union avp_value) ); |
2232 enumval = NULL; | 2229 CHECK_FCT_DO( ret = fd_dict_search(dict, DICT_ENUMVAL, ENUMVAL_BY_STRUCT, &req, &enumval, 0), goto error ); |
2230 } | |
2233 } | 2231 } |
2234 | 2232 |
2235 /* Call the callbacks */ | 2233 /* Call the callbacks */ |
2236 CHECK_FCT_DO( ret = fd_disp_call_cb_int( cb_list, msg, avp, session, action, app, cmd, avp->avp_model, enumval ), goto error ); | 2234 CHECK_FCT_DO( ret = fd_disp_call_cb_int( cb_list, msg, avp, session, action, app, cmd, avp->avp_model, enumval ), goto error ); |
2237 TEST_ACTION_STOP(); | 2235 TEST_ACTION_STOP(); |