diff --git a/src/mod/applications/mod_mongo/Makefile b/src/mod/applications/mod_mongo/Makefile index 9ce16b1171..7a6e1058ab 100644 --- a/src/mod/applications/mod_mongo/Makefile +++ b/src/mod/applications/mod_mongo/Makefile @@ -1,6 +1,6 @@ BASE=../../../.. -MONGO_CXX_DRIVER_VERSION=v1.8 +MONGO_CXX_DRIVER_VERSION=v2.4 MONGO_CXX_DRIVER_URL=http://downloads.mongodb.org/cxx-driver MONGO_CXX_DRIVER_TARBALL=mongodb-linux-x86_64-$(MONGO_CXX_DRIVER_VERSION)-latest.tgz MONGO_CXX_DRIVER_SRC=$(BASE)/libs/mongo-cxx-driver-$(MONGO_CXX_DRIVER_VERSION) @@ -9,7 +9,7 @@ LIBMONGOCLIENT_A =$(MONGO_CXX_DRIVER_SRC)/libmongoclient.a LOCAL_SOURCES=mongo_conn.cpp LOCAL_OBJS=mongo_conn.o -LOCAL_CFLAGS=-I$(MONGO_CXX_DRIVER_SRC)/mongo +LOCAL_CFLAGS=-I$(MONGO_CXX_DRIVER_SRC)/src LOCAL_LIBADD=$(LIBMONGOCLIENT_A) LOCAL_LDFLAGS=-lboost_thread -lboost_filesystem-mt -lboost_system-mt MODDIR=$(shell pwd) diff --git a/src/mod/applications/mod_mongo/fpic_hack.diff b/src/mod/applications/mod_mongo/fpic_hack.diff index 882f3c899a..1f85f85c97 100644 --- a/src/mod/applications/mod_mongo/fpic_hack.diff +++ b/src/mod/applications/mod_mongo/fpic_hack.diff @@ -1,11 +1,11 @@ ---- SConstruct.orig 2011-04-28 19:00:36.000000000 +0200 -+++ SConstruct 2011-04-28 19:01:19.000000000 +0200 -@@ -45,7 +45,7 @@ - linux = True +--- SConstruct 2013-10-30 17:18:51.160645496 -0400 ++++ new 2013-10-30 17:22:18.790072856 -0400 +@@ -78,7 +78,7 @@ + env['DIST_ARCHIVE_SUFFIX'] = '.tgz' if nix: -- env.Append( CPPFLAGS=" -O3" ) -+ env.Append( CPPFLAGS=" -I../pcre -fPIC -O3" ) - env.Append( LIBS=["pthread"] ) +- env.Append(CCFLAGS=["-O3", "-pthread"]) ++ env.Append(CCFLAGS=["-I../pcre", "-fPIC", "-O3", "-pthread"]) if linux: - env.Append( LINKFLAGS=" -Wl,--as-needed -Wl,-zdefs " ) + env.Append(LINKFLAGS=["-pthread"]) + diff --git a/src/mod/applications/mod_mongo/mod_mongo.cpp b/src/mod/applications/mod_mongo/mod_mongo.cpp index 811361be21..8c3536def2 100644 --- a/src/mod/applications/mod_mongo/mod_mongo.cpp +++ b/src/mod/applications/mod_mongo/mod_mongo.cpp @@ -62,7 +62,7 @@ SWITCH_STANDARD_API(mongo_mapreduce_function) BSONObj out; BSONObjBuilder cmd; - cmd.append("mapreduce", conn->nsGetCollection(ns)); + cmd.append("mapreduce", nsGetCollection(ns)); if (!zstr(globals.map)) { cmd.appendCode("map", globals.map); } @@ -79,7 +79,7 @@ SWITCH_STANDARD_API(mongo_mapreduce_function) conn = mongo_connection_pool_get(globals.conn_pool); if (conn) { - conn->runCommand(conn->nsGetDB(ns), cmd.done(), out); + conn->runCommand(nsGetDB(ns), cmd.done(), out); mongo_connection_pool_put(globals.conn_pool, conn, SWITCH_FALSE); stream->write_function(stream, "-OK\n%s\n", out.jsonString().c_str()); diff --git a/src/mod/applications/mod_mongo/mod_mongo.h b/src/mod/applications/mod_mongo/mod_mongo.h index df09434352..822dacaf63 100644 --- a/src/mod/applications/mod_mongo/mod_mongo.h +++ b/src/mod/applications/mod_mongo/mod_mongo.h @@ -32,10 +32,7 @@ #ifndef MOD_MONGO_H #define MOD_MONGO_H -#include -#include -#include -#include +#include using namespace mongo;