comparison libfdproto/messages.c @ 995:2016a0c46bda

Fixed Proxy-Info duplication, added a test case for this
author Sebastien Decugis <sdecugis@freediameter.net>
date Mon, 18 Mar 2013 16:19:47 +0100
parents 80584f0e851a
children d03f7e3805ad
comparison
equal deleted inserted replaced
994:1e1d6f94cd94 995:2016a0c46bda
386 free(buf); 386 free(buf);
387 } 387 }
388 /* move to next AVP in the message, we can have several Proxy-Info instances */ 388 /* move to next AVP in the message, we can have several Proxy-Info instances */
389 CHECK_FCT( fd_msg_browse(avp, MSG_BRW_NEXT, &avp, NULL) ); 389 CHECK_FCT( fd_msg_browse(avp, MSG_BRW_NEXT, &avp, NULL) );
390 } 390 }
391 CHECK_FCT( fd_msg_parse_dict( ans, dict, NULL ) );
391 } 392 }
392 393
393 /* associate with query */ 394 /* associate with query */
394 ans->msg_query = qry; 395 ans->msg_query = qry;
395 qry->msg_associated = 1; 396 qry->msg_associated = 1;
760 msg->msg_public.msg_code, 761 msg->msg_public.msg_code,
761 msg->msg_public.msg_appl, 762 msg->msg_public.msg_appl,
762 msg->msg_public.msg_hbhid, 763 msg->msg_public.msg_hbhid,
763 msg->msg_public.msg_eteid 764 msg->msg_public.msg_eteid
764 ) ); 765 ) );
765 CHECK_FCT( dump_add_str(outstr, offset, outlen, INOBJHDR "intern: rwb:%p rt:%d cb:%p(%p) qry:%p asso:%d sess:%p src:%s(%zd)|", 766 CHECK_FCT( dump_add_str(outstr, offset, outlen, INOBJHDR "intern: rwb:%p rt:%d cb:%p(%p) qry:%p asso:%d sess:%p src:%s(%zd)|\n",
766 INOBJHDRVAL, msg->msg_rawbuffer, msg->msg_routable, msg->msg_cb.fct, msg->msg_cb.data, msg->msg_query, msg->msg_associated, msg->msg_sess, msg->msg_src_id?:"(nil)", msg->msg_src_id_len) ); 767 INOBJHDRVAL, msg->msg_rawbuffer, msg->msg_routable, msg->msg_cb.fct, msg->msg_cb.data, msg->msg_query, msg->msg_associated, msg->msg_sess, msg->msg_src_id?:"(nil)", msg->msg_src_id_len) );
767 return 0; 768 return 0;
768 } 769 }
769 770
770 /* Dump an avp object */ 771 /* Dump an avp object */
817 } else { 818 } else {
818 CHECK_FCT( fd_dict_dump_avp_value(avp->avp_public.avp_value, avp->avp_model, indent, outstr, offset, outlen) ); 819 CHECK_FCT( fd_dict_dump_avp_value(avp->avp_public.avp_value, avp->avp_model, indent, outstr, offset, outlen) );
819 } 820 }
820 } 821 }
821 822
822 CHECK_FCT( dump_add_str(outstr, offset, outlen, INOBJHDR "intern: src:%p mf:%d raw:%p(%d)|", INOBJHDRVAL, avp->avp_source, avp->avp_mustfreeos, avp->avp_rawdata, avp->avp_rawlen) ); 823 CHECK_FCT( dump_add_str(outstr, offset, outlen, INOBJHDR "intern: src:%p mf:%d raw:%p(%d)|\n", INOBJHDRVAL, avp->avp_source, avp->avp_mustfreeos, avp->avp_rawdata, avp->avp_rawlen) );
823 return 0; 824 return 0;
824 } 825 }
825 826
826 /* Dump a single object content into out string, realloc if needed */ 827 /* Dump a single object content into out string, realloc if needed */
827 static int msg_dump_intern ( int level, msg_or_avp * obj, int indent, char **outstr, size_t *offset, size_t *outlen ) 828 static int msg_dump_intern ( int level, msg_or_avp * obj, int indent, char **outstr, size_t *offset, size_t *outlen )
"Welcome to our mercurial repository"