Re: [RFC] [PATCH] Let PLUGIN_RAW plugins alter message lengths

Thomas Ries <[email protected]> Sun, 25 May 2014 13:09:35 +0200
Newsgroups gmane.network.siproxd
Message-ID <[email protected]>
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--===============1313486794275895702==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature";
	boundary="PeTKeqCeNr4QdliLqPwj2fH1i1MoK3gx1"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--PeTKeqCeNr4QdliLqPwj2fH1i1MoK3gx1
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi Marc,

Thank you for pointing this out. This patch makes perfectly sense, I'll
include your changes into the code.

Best regards,
Thomas

On 05/21/2014 06:17 PM, Marc van der Wal wrote:
> Hi,
>=20
> I am currently developing a custom plugin for siproxd.  In some cases,
> it needs to modify the raw message buffer in order to work around
> libosip2's limitations (for example, libosip2 doesn't handle RFC
> 3966-style URIs correctly, while the upstream proxy I am communicating
> with uses those).
>=20
> However, by doing so I have noticed that the subsequent modified messag=
e
> gets truncated, even though my code recalculates ticket->raw_buffer_len=

> correctly.
>=20
> The issue lies in the fact that the buffer lengths used in the
> subsequent checks are no longer valid if these are modified during the
> PLUGIN_RAW phase.  Instead, the recalculated buffer lengths within the
> ticket should be used.
>=20
> My attached patch therefore modifies all these checks to use
> ticket.raw_buffer and ticket.raw_buffer_len instead of buff and buflen.=

> This is the only way I know to make this case (and a somewhat ugly one,=

> I know, hence the [RFC] tag) work correctly.
>=20
> This patch is designed for siproxd-0.8.0 but might also apply cleanly t=
o
> more recent source trees.
>=20
> Regards,
>=20
> Marc van der Wal
>=20
>=20
>=20
> -----------------------------------------------------------------------=
-------
> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos.
> Get unparalleled scalability from the best Selenium testing platform av=
ailable
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs
>=20
>=20
>=20
> _______________________________________________
> Siproxd-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/siproxd-users
>=20


--PeTKeqCeNr4QdliLqPwj2fH1i1MoK3gx1
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)

iEYEARECAAYFAlOBz3MACgkQB2xLpFxU+GUu8ACdHKVUYduuuhcbFwu+M88Daz/c
jtsAoI8VZWD0zN2atBjiDCvitcMq65Hr
=ikvC
-----END PGP SIGNATURE-----

--PeTKeqCeNr4QdliLqPwj2fH1i1MoK3gx1--


--===============1313486794275895702==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
--===============1313486794275895702==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Siproxd-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/siproxd-users

--===============1313486794275895702==--