comparison libfreeDiameter/messages.c @ 291:2d3a799ad29c

Cache the session pointer in answers when it was present in queries
author Sebastien Decugis <sdecugis@nict.go.jp>
date Mon, 10 May 2010 14:10:51 +0900
parents 3019f6220122
children e283e18b2673
comparison
equal deleted inserted replaced
290:7842bed901ca 291:2d3a799ad29c
333 CHECK_FCT( fd_msg_avp_new ( sess_id_avp, 0, &avp ) ); 333 CHECK_FCT( fd_msg_avp_new ( sess_id_avp, 0, &avp ) );
334 val.os.data = sid; 334 val.os.data = sid;
335 val.os.len = strlen(sid); 335 val.os.len = strlen(sid);
336 CHECK_FCT( fd_msg_avp_setvalue( avp, &val ) ); 336 CHECK_FCT( fd_msg_avp_setvalue( avp, &val ) );
337 CHECK_FCT( fd_msg_avp_add( ans, MSG_BRW_FIRST_CHILD, avp ) ); 337 CHECK_FCT( fd_msg_avp_add( ans, MSG_BRW_FIRST_CHILD, avp ) );
338 ans->msg_sess = sess;
339 CHECK_FCT( fd_sess_ref_msg(sess) );
338 } 340 }
339 341
340 /* associate with query */ 342 /* associate with query */
341 ans->msg_query = qry; 343 ans->msg_query = qry;
342 344
2205 } 2207 }
2206 2208
2207 /* So start browsing the message */ 2209 /* So start browsing the message */
2208 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 );
2209 while (avp != NULL) { 2211 while (avp != NULL) {
2210 /* Sanity */
2211 ASSERT( avp->avp_public.avp_value );
2212
2213 /* 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 */
2214 if (avp->avp_model) { 2213 if (avp->avp_model) {
2215 struct dict_object * type, * enumval; 2214 struct dict_object * type, * enumval;
2216 2215
2216 /* Sanity */
2217 ASSERT( avp->avp_public.avp_value );
2218
2217 /* Get the list of callback for this AVP */ 2219 /* Get the list of callback for this AVP */
2218 CHECK_FCT_DO( ret = fd_dict_disp_cb(DICT_AVP, avp->avp_model, &cb_list), goto error ); 2220 CHECK_FCT_DO( ret = fd_dict_disp_cb(DICT_AVP, avp->avp_model, &cb_list), goto error );
2219 2221
2220 /* Check if the AVP has a constant value */ 2222 /* Check if the AVP has a constant value */
2221 CHECK_FCT_DO( ret = fd_dict_search(dict, DICT_TYPE, TYPE_OF_AVP, avp->avp_model, &type, 0), goto error ); 2223 CHECK_FCT_DO( ret = fd_dict_search(dict, DICT_TYPE, TYPE_OF_AVP, avp->avp_model, &type, 0), goto error );
"Welcome to our mercurial repository"