mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-14 10:20:01 +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
@@ -10,9 +10,9 @@ static struct mg_serve_http_opts s_http_server_opts;
|
||||
static int s_sig_num = 0;
|
||||
static void *s_db_handle = NULL;
|
||||
static const char *s_db_path = "api_server.db";
|
||||
static const struct mg_str s_get_method = NS_STR("GET");
|
||||
static const struct mg_str s_put_method = NS_STR("PUT");
|
||||
static const struct mg_str s_delele_method = NS_STR("DELETE");
|
||||
static const struct mg_str s_get_method = MG_STR("GET");
|
||||
static const struct mg_str s_put_method = MG_STR("PUT");
|
||||
static const struct mg_str s_delele_method = MG_STR("DELETE");
|
||||
|
||||
static void signal_handler(int sig_num) {
|
||||
signal(sig_num, signal_handler);
|
||||
@@ -28,12 +28,12 @@ static int is_equal(const struct mg_str *s1, const struct mg_str *s2) {
|
||||
}
|
||||
|
||||
static void ev_handler(struct mg_connection *nc, int ev, void *ev_data) {
|
||||
static const struct mg_str api_prefix = NS_STR("/api/v1");
|
||||
static const struct mg_str api_prefix = MG_STR("/api/v1");
|
||||
struct http_message *hm = (struct http_message *) ev_data;
|
||||
struct mg_str key;
|
||||
|
||||
switch (ev) {
|
||||
case NS_HTTP_REQUEST:
|
||||
case MG_EV_HTTP_REQUEST:
|
||||
if (has_prefix(&hm->uri, &api_prefix)) {
|
||||
key.p = hm->uri.p + api_prefix.len;
|
||||
key.len = hm->uri.len - api_prefix.len;
|
||||
|
||||
Reference in new issue
Block a user