[reSIProcate] some bug with static Router
Dragos Dinu
ddinu at ezuce.com
Fri Jan 3 12:37:18 CST 2014
Hi guys,
I'm Dragos and I've recently been working with the resiprocate stack and
DUM code. I encountered the following problem:
*When sending a request to resiprocate DUM with a strict Record-Route URI,
the Helper::processStrictRoute is called:*
* // The next hop is a strict router. Move the next hop into the*
* // Request-URI and move the ultimate destination to the end of the*
* // route list. Force the message target to be the next hop router.*
*
request.header(h_Routes).push_back(NameAddr(request.const_header(h_RequestLine).uri()));*
* request.header(h_RequestLine).uri() =
request.const_header(h_Routes).front().uri();*
* request.header(h_Routes).pop_front(); // !jf!*
Before running this code, we already have a Route which should be replaced
with the RequestLine.
When pushing back the RequestLine in the routes vector, it seems that the
associated HeaderFieldValue of the already existing Route header is
deleted , probably because of a reallocation of the vector.
This leads to the fact that when we try to set the uri of the RequestLine
to the one of the Route, we try to use a freed buffer.
So what I did was save the uri and use it afterwards:
* Uri frontRouteUri = request.const_header(h_Routes).front().uri();*
*
request.header(h_Routes).push_back(NameAddr(request.const_header(h_RequestLine).uri()));*
* //request.header(h_RequestLine).uri() =
request.const_header(h_Routes).front().uri();*
* request.header(h_RequestLine).uri() = frontRouteUri;*
Seems to work, but I was thinking to ask you for your more experienced
opinion if this is the way to go. Thanks.
Regards,
Dragos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20140103/46e1ac85/attachment.htm>
More information about the resiprocate-devel
mailing list