Change old code to directly return `str` objects instead of pointers to
allocated ones. Largely a no-op change but makes some code easier and
eliminates some old kludges.
Change-Id: I2be19dd24bb7ff046d86cc32a3af235283e65dd0
Make the macro return the appropriate pointer type, and make sure the
free function takes an argument of the same type. This also eliminates
some boilerplate type-casting code.
Change-Id: I3094271fa2c53ec93b9ff9f837d461cf422e0f12
The pcre2 API was changed from
pcre2_substring_list_free(PCRE2_SPTR *)
to
pcre2_substring_list_free(PCRE2_UCHAR **)
in 10.43. The difference is a `const` qualifier. Work around this.
Closes#1869
Change-Id: Ib3dd3003352f6c3155bb47d69ecb7a1b02f4647a
In the file implementations follow the rules:
1. Firstly goes the correlated header file, then one empty row.
2. Secondly go system headers, so in angle-brackets, then one empty row.
3. Thirdly, go custom header files, so in double quotes,
then one empty row.
4. If there is "xt_RTPENGINE.h", it's mentioned next, but separately,
then one empty row.
5. If there are pre-processor definitions, they are added.
6. And eventually at least one empty row before the code.
In some situations it's allowed to step aside from the rules,
when inclusions are dependent on each other, so on the sequence,
and also possibly on some inline objects definitions, but if possible
to follow the rules, it's being done.
Change-Id: Ie512a970e230fe202398656d1942e8874bb14cd9
All functions that create listener objects take a read-only endpoint, so
make them as const.
Remove the extra TOS argument to make all signatures the same.
Change-Id: I722c7665b192476d90dbf0ece200d0bfd34cb9eb
We have long switched to having a single primary global poller, so
there's no point in passing the poller pointer around and storing it in
associated objects. Remove all remnants of non-global pollers.
Change-Id: I5a3fd217d5de51e839e2b04fec7e23643ee83631
All timers have been moved to their dedicated timer threads, making this
mechanism obsolete.
The only victim is the timeout handling for TCP control streams. Since
other TCP streams aren't using timeout handling either, and the TCP
control socket is barely used by anyone, we can live with not having a
dedicated timeout for these streams for now.
Change-Id: I83d9b9a844f4f494ad37b44f5d1312f272beff3f
This is useful for functions which are used both from a timer and from
other callers. These functions would reset the logging context at their
end to free the reference held by the logging context, which would
wrongly reset the logging context when the same function was called from
a different code path. Using a stack with push/pop semantics makes it
safe to use these functions from any code path.
Additionally introduce an explicit reset function that clears the entire
stack regardless of context. This reset function is called at the end of
every work iteration in every worker thread, just in case not everything
was popped from the stack.
Change-Id: I0e2c142b95806b26473c65a882737e39d161d24d
Handling of dual stack v4/v6 was previously done by the individual
listener objects for INADDR_ANY listening addresses. If listening on
INADDR_ANY was requested, then each listener would create two instances,
one for IPv4 and one for IPv6. This works fine for INADDR_ANY but fails
for listening on host names that resolve to multiple addresses, such as
`localhost`.
Solve this by relieving the listener objects from handling this and
instead handle it in the code setting up the listeners. If a host name
resolves to multiple addresses, then set up multiple listeners (up to
two supported currently). This allows us to listen on `localhost` by
default and have both 127.0.0.1 and ::1 active. INADDR_ANY is handled
specially by also setting up :: in that case.
Change-Id: I2a1e1d7090d7d23863c7a9bb1e89b85ad2ea44f4
Using the bitwise operator seems confusing here, and the boolean
operator will in addition short-circuit which should not be very
significant performance-wise, but still nice.
Change-Id: Icda38d7799aa264d9a6cc1f4a71587e60189b18e
This brings master up to date with branch `rfuchs/socket-rework` at
commit `b1bcc096b7`. The branches have diverged too much for a proper
merge, so this is a manual (squashed) merge.
The old master before this merge can be found in branch
`old-master-before-socket-rework` (commit `82199216b2`).
This is a complete rewrite of all socket handling routines. The most
important functional change is that sockets aren't indiscriminately
bound to INADDR_ANY (or rather in6addr_any), but instead are always
bound to their respective local interface address and with the correct
address family.
Side effects of this are that in multi-homed environments, multiple
sockets must be opened (one per interface address and family) which must
be taken into account when considering RLIMIT_NOFILE values. As a
benefit, this change allows rtpengine to utilize the full UDP port space
per interface address, instead of just one port space per machine.
The socket abstraction also makes it possible to support RTP over TCP in
the future.
Change-Id: If6cf4f42136229490186d2d2482fb4fc140c2b53
Creates a preliminary log tag with the call-id whenever possible.
Changes log level of underlying NG messages to DEBUG.
Does a pretty-printed dump of NG responses.
Closes#73