mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-07 16:01:30 +00:00
Rename Mongoose constants: NS_ -> MG_, NSF_ -> MG_F_
PUBLISHED_FROM=c9cc54df1883aa17606de2b1ffb30f0cd687d037
This commit is contained in:
1 parent
32ab35f61f
commit
e1dd3f06fe
41 files changed
+887
-883
No files matched your search
@@ -3,9 +3,9 @@ SOURCES = $(PROG).c ../../mongoose.c
|
||||
CFLAGS = -W -Wall -I../.. $(CFLAGS_EXTRA)
|
||||
|
||||
ifeq ($(SSL), openssl)
|
||||
CFLAGS += -DNS_ENABLE_SSL -lssl -lcrypto -lcrypto
|
||||
CFLAGS += -DMG_ENABLE_SSL -lssl -lcrypto -lcrypto
|
||||
else ifeq ($(SSL), krypton)
|
||||
CFLAGS += -DNS_ENABLE_SSL ../../../krypton/krypton.c
|
||||
CFLAGS += -DMG_ENABLE_SSL ../../../krypton/krypton.c
|
||||
endif
|
||||
|
||||
all: $(PROG)
|
||||
@@ -14,7 +14,7 @@ $(PROG): $(SOURCES)
|
||||
$(CC) $(SOURCES) -o $@ $(CFLAGS)
|
||||
|
||||
$(PROG).exe: $(SOURCES)
|
||||
cl $(SOURCES) /I../.. /MD /DNS_ENABLE_THREADS /Fe$@ advapi32.lib
|
||||
cl $(SOURCES) /I../.. /MD /DMG_ENABLE_THREADS /Fe$@ advapi32.lib
|
||||
|
||||
clean:
|
||||
rm -rf *.gc* *.dSYM *.exe *.obj *.o a.out $(PROG)
|
||||
@@ -34,16 +34,16 @@ static void s3_handler(struct mg_connection *nc, int ev, void *ev_data) {
|
||||
struct mg_connection *nc2 = (struct mg_connection *) nc->user_data;
|
||||
|
||||
switch (ev) {
|
||||
case NS_HTTP_REPLY:
|
||||
case MG_EV_HTTP_REPLY:
|
||||
if (nc2 != NULL) {
|
||||
mg_printf_http_chunk(nc2, "Error: %.*s", (int) hm->message.len,
|
||||
hm->message.p);
|
||||
mg_send_http_chunk(nc2, "", 0);
|
||||
}
|
||||
unlink_conns(nc);
|
||||
nc->flags |= NSF_SEND_AND_CLOSE;
|
||||
nc->flags |= MG_F_SEND_AND_CLOSE;
|
||||
break;
|
||||
case NS_CLOSE:
|
||||
case MG_EV_CLOSE:
|
||||
unlink_conns(nc);
|
||||
break;
|
||||
default:
|
||||
@@ -118,14 +118,14 @@ static void ev_handler(struct mg_connection *nc, int ev, void *ev_data) {
|
||||
struct http_message *hm = (struct http_message *) ev_data;
|
||||
|
||||
switch (ev) {
|
||||
case NS_HTTP_REQUEST:
|
||||
case MG_EV_HTTP_REQUEST:
|
||||
if (mg_vcmp(&hm->uri, "/upload") == 0) {
|
||||
handle_api_call(nc, hm); /* Handle RESTful call */
|
||||
} else {
|
||||
mg_serve_http(nc, hm, s_http_server_opts); /* Serve static content */
|
||||
}
|
||||
break;
|
||||
case NS_CLOSE:
|
||||
case MG_EV_CLOSE:
|
||||
unlink_conns(nc);
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in new issue
Block a user