This is a general refactor of the makefile with the introduction of
staged install.
Is now possible to install with make install DESTDIR=build
and it will build the default xlxd install structure under the build
folder.
This if extremely usefull for building deb packages without using root
user and without interfeering with the host xlxd installation.
It also define some standard make directory variables, all defaulted
to /xlxd, to better customize the software at compile time.
make staged install:
https://www.gnu.org/prep/standards/html_node/DESTDIR.html
make directory variables:
https://www.gnu.org/software/make/manual/html_node/Directory-Variables.html
This patch reverts the change done on v2.4.1, so that streams are closed immediately as it used to be (instead of relying on CheckStreamsTimeout) but fixes last packets sent back to sender, by doing basically what was already done before but on proper order to avoid the issue.
Relying on CheckStreamsTimeout actually introduces a problem: transmitting client gets "mute" for 1.6 sec. after each transmission, this means that if a 2nd client starts transmitting within this time frame then the "mute" client can't listen the beginning of the 2nd client transmission, the problem is even worst (i.e. critical) for DExtra because the "mute" client will not be able to get the header packet of the 2nd client transmission and this means that whole transmission is lost - this renders DExtra almost unusable on v2.4.1 unless all clients take special care about spaces between transmissions.
depending on the number of dplus clients connected on the reflector, in some cases (for eg. with 3 or 6 clients connected) only one client could actually get lots of header packets and the other clients get none
Maximum size of ICMP packet is 64k while buffer allocation was UDP_BUFFER_LENMAX, while read was up to 64k.
This will cause a crash on read in the subsequent read for packets with length greater than UDP_BUFFER_LENMAX via a buffer overflow.
The OnDvLastFramePacketIn() function closed the current stream before
HandleQueue() was called, so the stream's client lost it's stream master status
and HandleQueue() sent the client's last (stream closing) frame back to the
sender.
Applying this commit closes the stream only after HandleQueue() has been
called so no unnecessary call end frame reflection happens to the transmitting
client.