From: Peter H. <Pet...@ne...> - 2007-05-16 07:20:38
|
Charles=2C =20 You may notice the =93dest - key =3C 10004=94 in the code above the printf= =2E That limits the size so it is well within range=2E =20 Olivier=2C =20 I think a cast to unsigned int is the answer to avoid errors on systems where size=5Ft and int may be different=2E =20 Peter =20 =5F=5F=5F=5F=5F =20 From=3A Boulkroune=2C Olivier =28Non-HP=3AAtos Origin=29 =5Bmailto=3Aolivier=2Eboulkroune=40hp=2Ecom=5D=20 Sent=3A 16 May 2007 08=3A05 To=3A Charles P Wright=3B Peter Higginson Cc=3A sipp-devel=40lists=2Esourceforge=2Enet Subject=3A RE=3A =5BSipp-devel=5D =5BSipp-users=5D Content Length problem= =2C possible fix=2E =20 Hello all=2C =20 Indeed=2C =254zu is not recognized on our HP=5FUX systems=2C which uses aCC= as compiler=2E It causes the 2=2E0 version not to work on HP=5FUX=2E=20 I=92m going to replace it by =254u=2C as Charles adviced=2C at least in the= 2=2E0 branch=2E =20 Regards=2C =20 Olivier Boulkroune =20 =5F=5F=5F=5F=5F =20 De =3A sipp-devel-bounces=40lists=2Esourceforge=2Enet =5Bmailto=3Asipp-devel-bounces=40lists=2Esourceforge=2Enet=5D De la part de= Charles P Wright Envoy=E9=20=3A mardi 15 mai 2007 13=3A41 =C0=20=3A Peter Higginson Cc =3A sipp-devel=40lists=2Esourceforge=2Enet Objet =3A Re=3A =5BSipp-devel=5D =5BSipp-users=5D Content Length problem=2C= possible fix=2E =20 Peter=2C=20 You are absolutely right as to why the =254zu was added=2E If you want to= print a size=5Ft on 32-bit and 64-bit systems=2C you should use =25zu=2E An alte= rnative might be to just cast the results of the pointer arithmetic to an integer= =2C as we can assume that the content-length =28and probably any other lengths= we are dealing with=29 should be less than 4GB =28I couldn=27t find any max si= ze in the RFC=2C but for practical applications =28and any that expect to work=29= this would be fine=2E Then we can just use =25u=2E=20 Charles=20 sipp-users-bounces=40lists=2Esourceforge=2Enet wrote on 05/13/2007 05=3A01= =3A51 PM=3A =3E=20 =3E Martin=2C =3E=20 =3E The original code that I submitted for this had =254u - which I think w= ould be =3E better than =254d although in practice it would not matter=2E =3E=20 =3E The definition of =22z=22 in =254zu is=3A =22A following integer conver= sion =3E corresponds to a size=5Ft or ssize=5Ft argument=22=2E AFAIK this is tec= hnically =3E correct for the result of pointer arithmetic=2E =3E=20 =3E My guess is that you have a compiler that does not support the z option= =2E =3E=20 =3E I don=27t know where we go from here=3B my other assumption is that som= eone with =3E a 64 bit system needed the z to correctly print the result of pointer= =3E arithmetic =28or to get rid of some warning=29=2E =3E=20 =3E My suggestion is to leave the =254zu=2E If you want to suggest some conditional =3E compilation I would support that=2E =3E=20 =3E Peter =3E=20 =3E -----Original Message----- =3E From=3A sipp-users-bounces=40lists=2Esourceforge=2Enet =3E =5Bmailto=3Asipp-users-bounces=40lists=2Esourceforge=2Enet=5D On Behalf= Of =3E M=2EH=2EVanLeeuwen =3E Sent=3A 09 May 2007 06=3A03 =3E To=3A sipp-users=40lists=2Esourceforge=2Enet =3E Subject=3A =5BSipp-users=5D Content Length problem=2C possible fix=2E= =3E=20 =3E Hi=2C =3E=20 =3E =22Content Length=3A zu=22 seems to be generated from =254zu=2C changed= to =254d in the =3E following patch to fix the problem=2E =3E=20 =3E Martin =3E=20 =3E --- call=2Ecpp=2Eorig 2007-05-02 17=3A28=3A48=2E336760000 -0500= =3E +++ call=2Ecpp 2007-05-08 23=3A53=3A58=2E001734000 -0500 =3E =40=40 -2382=2C7 +2383=2C7 =40=40 =3E key =3D strstr=28length=5Fmarker=2C=22=5Cr=5Cn=5Cr=5Cn=22=29=3B= =3E if =28key =26=26 dest - key =3E 4 =26=26 dest - key =3C 10004= =29 =7B =3E char tmp =3D length=5Fmarker=5B4=5D=3B =3E - sprintf=28length=5Fmarker=2C =22=254zu=22=2C dest - key - 4 += len=5Foffset=29=3B =3E + sprintf=28length=5Fmarker=2C =22=254d=22=2C dest - key - 4 + l= en=5Foffset=29=3B =3E length=5Fmarker=5B4=5D =3D tmp=3B =3E =7D else =7B =3E // Other cases=3A Content-Length is 0 =3E=20 =3E -----------------------------------------------------------------------= -- =3E This SF=2Enet email is sponsored by DB2 Express =3E Download DB2 Express C - the FREE version of DB2 express and take =3E control of your XML=2E No limits=2E Just data=2E Click to get it now=2E= =3E http=3A//sourceforge=2Enet/powerbar/db2/ =3E =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 =3E Sipp-users mailing list =3E Sipp-users=40lists=2Esourceforge=2Enet =3E https=3A//lists=2Esourceforge=2Enet/lists/listinfo/sipp-users =3E=20 =3E=20 =3E=20 =3E=20 =3E=20 =3E ---------------------------------------------------------------------------= - ----------------- =3E This e-mail may contain confidential and/or privileged information=2E= =3E If you are not the intended recipient =28or have received this e-mail= =20 =3E in error=29 please =3E notify the sender immediately and delete this e-mail=2E Any=20 =3E unauthorized copying=2C =3E disclosure or distribution of the contents in this e-mail is=20 =3E strictly forbidden=2E =3E ---------------------------------------------------------------------------= - ----------------- =3E Newport Networks Limited is registered in England=2E Registration=20 =3E number 4067591=2E =3E Registered office=3A 6 St=2E Andrew Street=2C London EC4A 3LX =3E ---------------------------------------------------------------------------= - ----------------- =3E=20 =3E=20 =3E -----------------------------------------------------------------------= -- =3E This SF=2Enet email is sponsored by DB2 Express =3E Download DB2 Express C - the FREE version of DB2 express and take =3E control of your XML=2E No limits=2E Just data=2E Click to get it now=2E= =3E http=3A//sourceforge=2Enet/powerbar/db2/ =3E =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 =3E Sipp-users mailing list =3E Sipp-users=40lists=2Esourceforge=2Enet =3E https=3A//lists=2Esourceforge=2Enet/lists/listinfo/sipp-users ---------------------------------------------------------------------------= ------------------ This e-mail may contain confidential and/or privileged information=2E If you are not the intended recipient =28or have received this e-mail in er= ror=29 please notify the sender immediately and delete this e-mail=2E Any unauthorized co= pying=2C disclosure or distribution of the contents in this e-mail is strictly forbi= dden=2E ---------------------------------------------------------------------------= ------------------ Newport Networks Limited is registered in England=2E Registration number 40= 67591=2E Registered office=3A 6 St=2E Andrew Street=2C London EC4A 3LX ---------------------------------------------------------------------------= ------------------ |