Browse Source

Merge pull request #342 from erqan/make-rss-optional

option to disable rss at compilation
miguelfreitas
miguelfreitas 10 years ago
parent
commit
a655e25d73
  1. 8
      Makefile.am
  2. 25
      configure.ac
  3. 5
      src/bitcoinrpc.cpp

8
Makefile.am

@ -131,6 +131,10 @@ if USE_SSE2 @@ -131,6 +131,10 @@ if USE_SSE2
SSE2_SOURCES = src/scrypt-sse2.cpp
endif
if ENABLE_RSS
RSS_SOURCE = src/twister_rss.cpp
endif
BITCOIN_TWISTER_SOURCES = \
src/alert.cpp \
src/version.cpp \
@ -169,9 +173,9 @@ BITCOIN_TWISTER_SOURCES = \ @@ -169,9 +173,9 @@ BITCOIN_TWISTER_SOURCES = \
src/chainparams.cpp \
src/dhtproxy.cpp \
src/twister.cpp \
src/twister_rss.cpp \
src/twister_utils.cpp \
$(SSE2_SOURCES)
$(SSE2_SOURCES) \
$(RSS_SOURCES)
twisterd_SOURCES = $(LIBTORRENT_SOURCES) $(BITCOIN_TWISTER_SOURCES)

25
configure.ac

@ -393,6 +393,15 @@ AC_ARG_ENABLE( @@ -393,6 +393,15 @@ AC_ARG_ENABLE(
[[ARG_ENABLE_PYTHON_BINDING=no]]
)
AC_ARG_ENABLE(
[rss],
[AS_HELP_STRING(
[--enable-rss],
[enable rss feed [default=yes]])],
[[ARG_ENABLE_RSS=$enableval]],
[[ARG_ENABLE_RSS=yes]]
)
AC_ARG_WITH(
[libgeoip],
[AS_HELP_STRING(
@ -608,6 +617,20 @@ AS_CASE(["$ARG_ENABLE_POOL_ALLOC"], @@ -608,6 +617,20 @@ AS_CASE(["$ARG_ENABLE_POOL_ALLOC"],
AC_MSG_ERROR([Unknown option "$ARG_ENABLE_POOL_ALLOC". Use either "yes" or "no".])]
)
AC_MSG_CHECKING([whether rss feed should be enabled])
AS_CASE(["$ARG_ENABLE_RSS"],
["yes"|"on"], [
AC_MSG_RESULT([yes])
AC_DEFINE([ENABLE_RSS],[1],[Enable RSS])
CXXFLAGS="$CXXFLAGS -DENABLE_RSS "
],
["no"|"off"], [
AC_MSG_RESULT([no])
],
[AC_MSG_RESULT([$ARG_ENABLE_RSS])
AC_MSG_ERROR([Unknown option "$ARG_ENABLE_RSS". Use either "yes" or "no".])]
)
AS_ECHO
AS_ECHO "Checking for extra build files:"
@ -725,6 +748,7 @@ AM_CONDITIONAL([ENABLE_PYTHON_BINDING], [test "x$ARG_ENABLE_PYTHON_BINDING" = "x @@ -725,6 +748,7 @@ AM_CONDITIONAL([ENABLE_PYTHON_BINDING], [test "x$ARG_ENABLE_PYTHON_BINDING" = "x
AM_CONDITIONAL([WITH_SHIPPED_GEOIP], [test "x$ARG_WITH_LIBGEOIP" = "xno" ])
AM_CONDITIONAL([WITH_OPENSSL], [test "x$ARG_ENABLE_ENCRYPTION" = "xyes" -o "x$ARG_ENABLE_ENCRYPTION" = "xon" ])
AM_CONDITIONAL([USE_SSE2], [test "x$ARG_ENABLE_SSE2" = "xyes" -o "x$ARG_ENABLE_SSE2" = "xon" ])
AM_CONDITIONAL([ENABLE_RSS], [test "x$ARG_ENABLE_RSS" = "xyes" -o "x$ARG_ENABLE_RSS" = "xon" ])
###############################################################################
# Other useful stuff
@ -827,6 +851,7 @@ Features: @@ -827,6 +851,7 @@ Features:
geoip support: ${ARG_ENABLE_GEOIP:-yes}
dht support: ${ARG_ENABLE_DHT:-yes}
pool allocators: ${ARG_ENABLE_POOL_ALLOC:-yes}
rss feed: ${ARG_ENABLE_RSS:-yes}
Extra builds:
examples: ${ARG_ENABLE_EXAMPLES:-no}

5
src/bitcoinrpc.cpp

@ -13,7 +13,10 @@ @@ -13,7 +13,10 @@
#include "db.h"
#include "twister_utils.h"
#ifdef ENABLE_RSS
#include "twister_rss.h"
#endif // ENABLE_RSS
#include <boost/algorithm/string.hpp>
#include <boost/asio.hpp>
@ -1057,6 +1060,7 @@ void ServiceConnection(AcceptedConnection *conn) @@ -1057,6 +1060,7 @@ void ServiceConnection(AcceptedConnection *conn)
continue;
}
#ifdef ENABLE_RSS
if(strMethod == "GET" && strURI.substr(0, 4) == "/rss" && !GetBoolArg("-public_server_mode",false))
{
string rssOutput;
@ -1081,6 +1085,7 @@ void ServiceConnection(AcceptedConnection *conn) @@ -1081,6 +1085,7 @@ void ServiceConnection(AcceptedConnection *conn)
continue;
}
}
#endif // ENABLE_RSS
JSONRequest jreq;
try

Loading…
Cancel
Save