diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index ef57a6e6..7be7e778 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -1057,6 +1057,9 @@ void ServiceConnection(AcceptedConnection *conn) case RSS_ERROR_NOT_A_NUMBER: conn->stream() << HTTPReply(HTTP_BAD_REQUEST, "Parameter 'max' must be a number", false) << std::flush; continue; + case RSS_ERROR_BOOST_REGEX: + conn->stream() << HTTPReply(HTTP_BAD_REQUEST, "boost-regex support missing", false) << std::flush; + continue; } } diff --git a/src/twister_rss.cpp b/src/twister_rss.cpp index 355b1824..6bc9f3dc 100644 --- a/src/twister_rss.cpp +++ b/src/twister_rss.cpp @@ -7,7 +7,9 @@ #include #include #include -#include +#ifdef HAVE_BOOST_REGEX + #include +#endif #include using namespace std; @@ -15,6 +17,9 @@ using namespace json_spirit; int generateRSS(string uri, string *output) { +#ifndef HAVE_BOOST_REGEX + return RSS_ERROR_BOOST_REGEX; +#else map parameterMap = parseQuery(uri); int max = 20; //default value string account = parameterMap["account"]; @@ -188,8 +193,10 @@ int generateRSS(string uri, string *output) *output = ret.str(); return RSS_OK; +#endif } +#ifdef HAVE_BOOST_REGEX map parseQuery(const string& query) { map data; @@ -206,6 +213,7 @@ map parseQuery(const string& query) return data; } +#endif bool sortByTime (Object i,Object j) { diff --git a/src/twister_rss.h b/src/twister_rss.h index f57a42d6..b050c9d2 100644 --- a/src/twister_rss.h +++ b/src/twister_rss.h @@ -10,11 +10,14 @@ enum RSSResultCode RSS_OK = 0, RSS_ERROR_NO_ACCOUNT = -1, RSS_ERROR_BAD_ACCOUNT = -2, - RSS_ERROR_NOT_A_NUMBER = -3 + RSS_ERROR_NOT_A_NUMBER = -3, + RSS_ERROR_BOOST_REGEX = -4 }; extern bool sortByTime (json_spirit::Object i,json_spirit::Object j); -extern std::map parseQuery(const std::string& query); +#ifdef HAVE_BOOST_REGEX + extern std::map parseQuery(const std::string& query); +#endif extern int generateRSS(std::string uri, std::string *output); #endif // TWISTER_RSS_H