From: Boulkroune, O. \(Non-HP:A. Origin\) <oli...@hp...> - 2007-05-16 07:04:56
|
Hello all, =20 Indeed, %4zu is not recognized on our HP_UX systems, which uses aCC as = compiler. It causes the 2.0 version not to work on HP_UX.=20 I'm going to replace it by %4u, as Charles adviced, at least in the 2.0 = branch. =20 Regards, =20 Olivier Boulkroune =20 ________________________________ De : sip...@li... = [mailto:sip...@li...] De la part de Charles = P Wright Envoy=E9 : mardi 15 mai 2007 13:41 =C0 : Peter Higginson Cc : sip...@li... Objet : Re: [Sipp-devel] [Sipp-users] Content Length problem, possible = fix. =20 Peter,=20 You are absolutely right as to why the %4zu was added. If you want to = print a size_t on 32-bit and 64-bit systems, you should use %zu. An = alternative might be to just cast the results of the pointer arithmetic = to an integer, as we can assume that the content-length (and probably = any other lengths we are dealing with) should be less than 4GB (I = couldn't find any max size in the RFC, but for practical applications = (and any that expect to work) this would be fine. Then we can just use = %u.=20 Charles=20 sip...@li... wrote on 05/13/2007 05:01:51 = PM: >=20 > Martin, >=20 > The original code that I submitted for this had %4u - which I think = would be > better than %4d although in practice it would not matter. >=20 > The definition of "z" in %4zu is: "A following integer conversion > corresponds to a size_t or ssize_t argument". AFAIK this is = technically > correct for the result of pointer arithmetic. >=20 > My guess is that you have a compiler that does not support the z = option. >=20 > I don't know where we go from here; my other assumption is that = someone with > a 64 bit system needed the z to correctly print the result of pointer > arithmetic (or to get rid of some warning). >=20 > My suggestion is to leave the %4zu. If you want to suggest some = conditional > compilation I would support that. >=20 > Peter >=20 > -----Original Message----- > From: sip...@li... > [mailto:sip...@li...] On Behalf Of > M.H.VanLeeuwen > Sent: 09 May 2007 06:03 > To: sip...@li... > Subject: [Sipp-users] Content Length problem, possible fix. >=20 > Hi, >=20 > "Content Length: zu" seems to be generated from %4zu, changed to %4d = in the > following patch to fix the problem. >=20 > Martin >=20 > --- call.cpp.orig 2007-05-02 17:28:48.336760000 -0500 > +++ call.cpp 2007-05-08 23:53:58.001734000 -0500 > @@ -2382,7 +2383,7 @@ > key =3D strstr(length_marker,"\r\n\r\n"); > if (key && dest - key > 4 && dest - key < 10004) { > char tmp =3D length_marker[4]; > - sprintf(length_marker, "%4zu", dest - key - 4 + len_offset); > + sprintf(length_marker, "%4d", dest - key - 4 + len_offset); > length_marker[4] =3D tmp; > } else { > // Other cases: Content-Length is 0 >=20 > = -------------------------------------------------------------------------= > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Sipp-users mailing list > Sip...@li... > https://lists.sourceforge.net/lists/listinfo/sipp-users >=20 >=20 >=20 >=20 >=20 > = -------------------------------------------------------------------------= -------------------- > This e-mail may contain confidential and/or privileged information. > If you are not the intended recipient (or have received this e-mail=20 > in error) please > notify the sender immediately and delete this e-mail. Any=20 > unauthorized copying, > disclosure or distribution of the contents in this e-mail is=20 > strictly forbidden. > = -------------------------------------------------------------------------= -------------------- > Newport Networks Limited is registered in England. Registration=20 > number 4067591. > Registered office: 6 St. Andrew Street, London EC4A 3LX > = -------------------------------------------------------------------------= -------------------- >=20 >=20 > = -------------------------------------------------------------------------= > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Sipp-users mailing list > Sip...@li... > https://lists.sourceforge.net/lists/listinfo/sipp-users |