Commit
e2cc8c0 lost argument nullification when converting old
HTTPMSGUNLOCK() macro into a function. This change restores that
important part of the HTTPMSGUNLOCK() API without sacrificing argument
type checks added during that conversion.
#include "http/ProtocolVersion.h"
#include "http/StatusCode.h"
#include "HttpHeader.h"
+#include <type_traits>
namespace Http
{
} // namespace Http
+template <class M>
inline void
-HTTPMSGUNLOCK(Http::Message *a)
+HTTPMSGUNLOCK(M *&a)
{
+ static_assert(std::is_base_of<Http::Message, M>::value, "M must inherit from Http::Message");
if (a) {
if (a->unlock() == 0)
delete a;