From f2f74754c9a9d67e060042ebfbd91731697fe806 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Sun, 22 Dec 2013 22:16:48 -0800 Subject: [PATCH] rgw: switch mongoose to civetweb Fixes: #7054 mongoose is now GPL, using the civetweb fork instead. Signed-off-by: Yehuda Sadeh --- .gitmodules | 3 +++ src/civetweb | 1 + src/rgw/Makefile.am | 11 +++++++---- src/rgw/{rgw_mongoose.cc => rgw_civetweb.cc} | 4 ++-- src/rgw/{rgw_mongoose.h => rgw_civetweb.h} | 0 src/rgw/rgw_main.cc | 10 +++++----- 6 files changed, 18 insertions(+), 11 deletions(-) create mode 160000 src/civetweb rename src/rgw/{rgw_mongoose.cc => rgw_civetweb.cc} (98%) rename src/rgw/{rgw_mongoose.h => rgw_civetweb.h} (100%) diff --git a/.gitmodules b/.gitmodules index 454d7165e82..08bb24d1ff8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "src/mongoose"] path = src/mongoose url = git://github.com/ceph/mongoose.git +[submodule "src/civetweb"] + path = src/civetweb + url = git@github.com:ceph/civetweb diff --git a/src/civetweb b/src/civetweb new file mode 160000 index 00000000000..400f29c108b --- /dev/null +++ b/src/civetweb @@ -0,0 +1 @@ +Subproject commit 400f29c108b35fe40f7290d3fff62c6892801e13 diff --git a/src/rgw/Makefile.am b/src/rgw/Makefile.am index a0388396d8c..8e7b1337bce 100644 --- a/src/rgw/Makefile.am +++ b/src/rgw/Makefile.am @@ -51,6 +51,8 @@ LIBRGW_DEPS += \ -lfcgi \ -ldl +CIVETWEB = civetweb + radosgw_SOURCES = \ rgw/rgw_resolve.cc \ rgw/rgw_rest.cc \ @@ -69,9 +71,10 @@ radosgw_SOURCES = \ rgw/rgw_swift.cc \ rgw/rgw_swift_auth.cc \ rgw/rgw_loadgen.cc \ - rgw/rgw_mongoose.cc \ - mongoose/mongoose.c \ + rgw/rgw_civetweb.cc \ + $(CIVETWEB)/src/civetweb.c \ rgw/rgw_main.cc +radosgw_CFLAGS = -I$(CIVETWEB)/include radosgw_LDADD = $(LIBRGW) $(LIBRGW_DEPS) $(RESOLV_LIBS) $(CEPH_GLOBAL) bin_PROGRAMS += radosgw @@ -154,6 +157,6 @@ noinst_HEADERS += \ rgw/rgw_user.h \ rgw/rgw_bucket.h \ rgw/rgw_keystone.h \ - rgw/rgw_mongoose.h \ - mongoose/mongoose.h + rgw/rgw_civetweb.h \ + civetweb/civetweb.h diff --git a/src/rgw/rgw_mongoose.cc b/src/rgw/rgw_civetweb.cc similarity index 98% rename from src/rgw/rgw_mongoose.cc rename to src/rgw/rgw_civetweb.cc index 3aa493fec79..a31177fb394 100644 --- a/src/rgw/rgw_mongoose.cc +++ b/src/rgw/rgw_civetweb.cc @@ -1,8 +1,8 @@ #include -#include "mongoose/mongoose.h" -#include "rgw_mongoose.h" +#include "civetweb/civetweb.h" +#include "rgw_civetweb.h" #define dout_subsys ceph_subsys_rgw diff --git a/src/rgw/rgw_mongoose.h b/src/rgw/rgw_civetweb.h similarity index 100% rename from src/rgw/rgw_mongoose.h rename to src/rgw/rgw_civetweb.h diff --git a/src/rgw/rgw_main.cc b/src/rgw/rgw_main.cc index c8ed9146d82..e1aa3d45000 100644 --- a/src/rgw/rgw_main.cc +++ b/src/rgw/rgw_main.cc @@ -53,9 +53,9 @@ #include "rgw_tools.h" #include "rgw_resolve.h" #include "rgw_loadgen.h" -#include "rgw_mongoose.h" +#include "rgw_civetweb.h" -#include "mongoose/mongoose.h" +#include "civetweb/civetweb.h" #include #include @@ -673,7 +673,7 @@ void RGWLoadGenProcess::handle_request(RGWRequest *r) } -static int mongoose_callback(struct mg_connection *conn) { +static int civetweb_callback(struct mg_connection *conn) { struct mg_request_info *req_info = mg_get_request_info(conn); RGWProcessEnv *pe = (RGWProcessEnv *)req_info->user_data; RGWRados *store = pe->store; @@ -928,7 +928,7 @@ public: struct mg_callbacks cb; memset((void *)&cb, 0, sizeof(cb)); - cb.begin_request = mongoose_callback; + cb.begin_request = civetweb_callback; ctx = mg_start(&cb, &env, (const char **)&options); if (!ctx) { @@ -1122,7 +1122,7 @@ int main(int argc, const char **argv) RGWProcessEnv fcgi_pe = { store, &rest, olog, 0 }; fe = new RGWFCGXFrontend(fcgi_pe, config); - } else if (framework == "mongoose") { + } else if (framework == "civetweb" || framework == "mongoose") { string err; int port;