Commit ffbd2a0f authored by Teemu Ikonen's avatar Teemu Ikonen Committed by Philippe Gorley

Fix 'configure --enable-restbed-old-api'.

(It would probably be enough to just include config.h, but now the
intention is clearer)

Change-Id: Ia427d940b5b9e94b6ba174fc38e9d638d507ae45
Reviewed-by: Philippe Gorley's avatarPhilippe Gorley <philippe.gorley@savoirfairelinux.com>
parent 97579542
......@@ -430,7 +430,7 @@ AC_ARG_WITH([restcpp],
AS_HELP_STRING([--with-restcpp], [enable rest support with C++]))
AC_ARG_ENABLE([restbed_old_api], AS_HELP_STRING([--enable-restbed-old-api], [Use the old restbed API]))
AS_IF([test "x$enable_restbed_old_api" = "xyes"], [
AC_DEFINE([RESTBED_OLD_API], [], [Defined if you use the old restbed API])
AC_DEFINE([RESTBED_OLD_API], [1], [Defined if you use the old restbed API])
])
AS_IF([test "x$enable_ringns" != "xno" || test "x$with_restcpp" = "xyes"], [
......
......@@ -21,6 +21,7 @@
#include "string_utils.h"
#include "thread_pool.h"
#include "fileutils.h"
#include "config.h"
#include <msgpack.hpp>
#include <json/json.h>
......@@ -93,10 +94,11 @@ NameDirectory& NameDirectory::instance(const std::string& server)
size_t getContentLength(restbed::Response& reply)
{
size_t length = 0;
#ifndef RESTBED_OLD_API
length =
#endif
#ifdef RESTBED_OLD_API
reply.get_header("Content-Length", length);
#else
length = reply.get_header("Content-Length", 0);
#endif
return length;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment