The libupnpp library, which provides the C++ interface for upmpdcli and upplay, used to rely on the venerable libupnp library (a.k.a pupnp: Portable UPnP) to provide the base UPnP protocol functionality.
Pupnp is very old and has suffered for a number of years from indifferent maintenance resulting in buggy releases being shipped by the Linux distributions (and endless trouble for me). For a few years now, I had to ship a patched version of an older release of the library with upmpdcli and upplay.
I did make an effort to help with a situation, and contributed a number of significant bug fixes to the package. See this, for example, or the Github pull requests. However, after a few years of suffering, I came to the conclusion that the situation was unsalvageable, and, at the beginning of 2020, I created a new library, named libnpupnp (new pupnp), based of the best and most specific parts of the old code. The changes:
The custom XML library (ixml) is not used any more (expat is used instead to parse XML when needed).
The HTTP server and client parts have respectively been replaced by libmicrohttpd and libcurl, two well-maintained and widely used libraries.
The retained code has been converted to C++, and most of the locally grown containers (lists etc.) have been replaced by STL objects.
Not even counting the ixml disparition (ixml was never a big issue), this brought the UPnP part of the library from around 24000 lines (C files only) to a manageable 13000 lines of C++, retaining the really UPnP-specific parts of the old library.
The current implementation has a C++ interface, because of the use of STL containers to replace XML DOM trees in a couple of entry points. It would be reasonably easy to add a pure C interface if someone saw a point to it.
Of course there is no chance that the new library is free of bugs, but I think that they will be easier to find and fix than previously.
The Web server function inside the new library is not really fit to be used as a general purpose Web server (even less than the equivalent in pupnp). I do think that it’s better to use a separate microhttpd instance to serve media, but I am still hesitating between completing the web server function or just trimming it down even a bit more to only serve the UPnP XML files. Don’t hesitate to contact me if you think of using the lib and something is lacking.
In practise, the libupnpp layer has isolated the applications from these changes, and upmpdcli and upplay can still be built with libupnpp 0.17.x and libupnp. But the default is now to build the packages with libupnpp 0.18.x and libnpupnp.
Bye bye pupnp, hello npupnp…