From: Charles P W. <cpw...@us...> - 2007-08-08 19:01:49
|
Olivier, I found the latest version to still have a defect in that multiple headers = were still not correctly included. I committed a fix for this. I am also=20 attaching two XML scenarios (a UAC and UAS) that are designed to be used=20 back to back, which verify the proper behavior of the last header using=20 actions. These scenarios can be run as: ./sipp -sf test-uas.xml -m 1 ./sipp -sf test-uac.xml -m 1 -trace=5Flogs localhost If the call was successful, then the UAC returns 0, otherwise it returns=20 97 to the shell. Anatoly, what was the test case that you were using for your patch? I do=20 have a case where a header is empty. In this code if the original message = has: Baz; Baz: value The [last=5FBaz:] keyword returns "Baz:, value". Olivier, I know that you said you were running some regression tests=20 before a 3.0 release. This is an example of how a regression suite would=20 be useful. Maybe, we can create a directory of simple XML scripts that=20 attempt to do some self-verification? Do you already have such a local=20 repository? Charles -- Dr. Charles P. Wright Research Staff Member Network Server Systems Software IBM T.J. Watson Research Center "Boulkroune, Olivier (Non-HP:Atos Origin)" <oli...@hp...>=20 wrote on 08/01/2007 12:34:07 PM: > Oops......I corrected this in the latest revision (293). Sorry about=20 that. >=20 > Thanks and regards, >=20 > Olivier Boulkroune >=20 > -----Message d'origine----- > De : Anatoly Pidruchny [mailto:api...@ne...]=20 > Envoy=E9 : mercredi 1 ao=FBt 2007 17:45 > =C0 : Boulkroune, Olivier (Non-HP:Atos Origin) > Cc : Charles P Wright; sip...@li...;=20 > api...@us... > Objet : Re: [Sipp-devel] [Sipp-commits] SF.net SVN: sipp: [292] > sipp/trunk/call.cpp >=20 > Olivier, >=20 > sorry that I did not verify that earlier. But you did not apply my patch = > correctly! Below is the part from my proposed patch. Please pay=20 > attention to the two modified lines that start from '!' character: >=20 > *************** > *** 1174,1192 **** > // Add "," when several headers are present > if (dest !=3D last=5Fheader) { > /* Remove trailing whitespaces, tabs, and CRs */ > - *(dest--) =3D 0; > while ((dest > last=5Fheader) && > ! ((*dest =3D=3D ' ') || (*dest =3D=3D '\r')|| (*dest =3D=3D = '\t'))) { > ! *(dest--) =3D 0; > } >=20 > dest +=3D sprintf(dest, ","); > - > - /* We only want to append the contents of the header, not its=20 > name for > - * the second value. */ > - if (!content) { > - src +=3D strlen(name); > - } > } > dest +=3D sprintf(dest, "%s", src); > if(ptr) { *ptr =3D '\n'; } > --- 1176,1187 ---- > // Add "," when several headers are present > if (dest !=3D last=5Fheader) { > /* Remove trailing whitespaces, tabs, and CRs */ > while ((dest > last=5Fheader) && > ! ((*(dest-1) =3D=3D ' ') || (*(dest-1) =3D=3D '\r')|| (*(des= t-1) =3D=3D=20 > '\t'))) { > ! *(--dest) =3D 0; > } >=20 > dest +=3D sprintf(dest, ","); > } > dest +=3D sprintf(dest, "%s", src); > if(ptr) { *ptr =3D '\n'; } >=20 >=20 > In revision 284 of call.cpp file you removed the "*(dest--) =3D 0;", but = > you did not modify these two lines. Of course this causes the problem. I = > still think that it is better to do this my way. Instead of: >=20 > /* Remove trailing whitespaces, tabs, and CRs */ > *(dest--) =3D 0; > while ((dest > last=5Fheader) && > ((*dest =3D=3D ' ') || (*dest =3D=3D '\r')|| (*dest =3D=3D '\= t'))) { > *(dest--) =3D 0; > } >=20 > It is better to do: >=20 > /* Remove trailing whitespaces, tabs, and CRs */ > while ((dest > last=5Fheader) && > ((*(dest-1) =3D=3D ' ') || (*(dest-1) =3D=3D '\r')|| (*(dest-= 1) =3D=3D=20 > '\t'))) { > *(--dest) =3D 0; > } >=20 > As I explained in that discussion on sourceforge.net, the difference is=20 > that my code will handle better the situation when the first instance of = > the header is empty. >=20 > Regards, >=20 > Anatoly. > > > > Charles, > > > >=20 > > > > This change was committed following this discussion :=20 > > http://sourceforge.net/tracker/index.php? > func=3Ddetail&aid=3D1733760&group=5Fid=3D104305&atid=3D637566=20 > > <http://sourceforge.net/tracker/index.php? > func=3Ddetail&aid=3D1733760&group=5Fid=3D104305&atid=3D637566>=20 > > > > > >=20 > > > > Olivier Boulkroune > > > >=20 > > > >=20 ------------------------------------------------------------------------ > > > > *De :* sip...@li...=20 > > [mailto:sip...@li...] *De la part de*=20 > > Charles P Wright > > *Envoy=E9 :* mercredi 1 ao=FBt 2007 16:11 > > *=C0 :* sip...@li...; oli...@hp... > > *Objet :* Re: [Sipp-devel] [Sipp-commits] SF.net SVN: sipp:=20 > > [292]sipp/trunk/call.cpp > > > >=20 > > > > > > Olivier, > > > > Do you know what the test case for r284 was? I found that the removal = > > of the dest--, prevented multiple headers from being properly included = > > in the last=5F keyword. > > > > Charles > > > > sip...@li... wrote on 08/01/2007=20 > > 10:03:30 AM: > > > > > Revision: 292 > > > http://sipp.svn.sourceforge.net/sipp/?rev=3D292&view=3Drev > > > Author: charlespwright > > > Date: 2007-08-01 07:03:30 -0700 (Wed, 01 Aug 2007) > > > > > > Log Message: > > > ----------- > > > Fix: last=5F* keyword should include multiple header instances (fixes > > > regression in r284). > > > > > > Modified Paths: > > > -------------- > > > sipp/trunk/call.cpp > > > > > > Modified: sipp/trunk/call.cpp > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > --- sipp/trunk/call.cpp 2007-08-01 14:02:58 UTC (rev 291) > > > +++ sipp/trunk/call.cpp 2007-08-01 14:03:30 UTC (rev 292) > > > @@ -1095,6 +1095,7 @@ > > > // Add "," when several headers are present > > > if (dest !=3D last=5Fheader) { > > > /* Remove trailing whitespaces, tabs, and CRs */ > > > + *(dest--) =3D 0; > > > while ((dest > last=5Fheader) && > > > ((*dest =3D=3D ' ') || (*dest =3D=3D '\r')|| (*dest =3D=3D '\= t'))) { > > > *(dest--) =3D 0; > > > > > > > > > This was sent by the SourceForge.net collaborative development > > > platform, the world's largest Open Source development site. > > > > > >=20 ------------------------------------------------------------------------- > > > This SF.net email is sponsored by: Splunk Inc. > > > Still grepping through log files to find problems? Stop. > > > Now Search log events and configuration files using AJAX and a=20 browser. > > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > > =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F > > > Sipp-commits mailing list > > > Sip...@li... > > > https://lists.sourceforge.net/lists/listinfo/sipp-commits > > >=20 |