[Siproxd-users] [RFC] [PATCH] Let PLUGIN_RAW plugins alter message lengths
Status: Beta
Brought to you by:
tries
From: Marc v. d. W. <x0r...@x0...> - 2014-05-21 16:47:29
|
Hi, 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). However, by doing so I have noticed that the subsequent modified message gets truncated, even though my code recalculates ticket->raw_buffer_len correctly. 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. 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. This patch is designed for siproxd-0.8.0 but might also apply cleanly to more recent source trees. Regards, Marc van der Wal |