This patch adds two new EMM counters in the regular stats messages.
Now the counters are:
Received - How much EMMs were received from the input.
Skipped - How much EMMs were skipped because of filtering.
Sent - How much EMMs were added to the sending queue.
Processed - How much EMMs were sent to the CAMD server for processing.
Add support for IPv6 and for multiple CAMD addresses.
This patch adds support for connecting to CAMD over IPv6. Nice addition
is that now tsdecrypt tries each of the addresses returned when CAMD
hostname is resolved and connects to the one that works. Resolving
of the server address is done before each connect, which allows for
uninterupted migration of CAMD servers by just changing their DNS
record.
IPv6 functionality can be disabled by using -4/--ipv4 options or
if you fancy only IPv6 servers -6/--ipv6 can be used.
This time free the memory returned by crypt() only once. This way
the leak is avoided and also double free error is avoided also.
The patch fixes the following valgrind compaint:
43 bytes in 1 blocks are still reachable in loss record 1 of 1
at 0x4026844: malloc (vg_replace_malloc.c:263)
by 0x40268BE: realloc (vg_replace_malloc.c:632)
by 0x41EE411: __md5_crypt (in /lib/libcrypt-2.13.so)
by 0x41EDA56: crypt (in /lib/libcrypt-2.13.so)
by 0x805F702: newcamd_login (camd-newcamd.c:297)
by 0x9F0B10: ???
Raise errors flags for ecm/emm processing only after couple of bad events.
This prevents unnececary warnings. Sometimes OSCAM responds with error
and on the next query everything is OK. So before raising errors flags
try a couple of times.
Use different queues for ECMs and EMMs. This allows to process
ECMs before EMMs, preventing the case where too much incoming
EMMs slow down ECM processing and interfere with getting the code
words on time.