Skip to content

Commit

Permalink
rgw: switch mongoose to civetweb
Browse files Browse the repository at this point in the history
Fixes: ceph#7054
mongoose is now GPL, using the civetweb fork instead.

Signed-off-by: Yehuda Sadeh <[email protected]>
  • Loading branch information
yehudasa committed Jan 23, 2014
1 parent d8bafae commit f2f7475
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "src/mongoose"]
path = src/mongoose
url = git://github.com/ceph/mongoose.git
[submodule "src/civetweb"]
path = src/civetweb
url = [email protected]:ceph/civetweb
1 change: 1 addition & 0 deletions src/civetweb
Submodule civetweb added at 400f29
11 changes: 7 additions & 4 deletions src/rgw/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ LIBRGW_DEPS += \
-lfcgi \
-ldl

CIVETWEB = civetweb

radosgw_SOURCES = \
rgw/rgw_resolve.cc \
rgw/rgw_rest.cc \
Expand All @@ -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

Expand Down Expand Up @@ -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

4 changes: 2 additions & 2 deletions src/rgw/rgw_mongoose.cc → src/rgw/rgw_civetweb.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

#include <string.h>

#include "mongoose/mongoose.h"
#include "rgw_mongoose.h"
#include "civetweb/civetweb.h"
#include "rgw_civetweb.h"


#define dout_subsys ceph_subsys_rgw
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions src/rgw/rgw_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 <map>
#include <string>
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -928,7 +928,7 @@ class RGWMongooseFrontend : public RGWFrontend {

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) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit f2f7475

Please sign in to comment.