mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-18 10:59:45 +00:00
remove http_match_uri()
This commit is contained in:
1 parent
e6bf658271
commit
ef61d6ea48
34 files changed
+83
-93
No files matched your search
+2
-6
@@ -914,10 +914,6 @@ struct mg_str mg_http_get_header_var(struct mg_str s, struct mg_str v) {
|
||||
return mg_str_n(NULL, 0);
|
||||
}
|
||||
|
||||
bool mg_http_match_uri(const struct mg_http_message *hm, const char *glob) {
|
||||
return mg_match(hm->uri, mg_str(glob), NULL);
|
||||
}
|
||||
|
||||
long mg_http_upload(struct mg_connection *c, struct mg_http_message *hm,
|
||||
struct mg_fs *fs, const char *dir, size_t max_size) {
|
||||
char buf[20] = "0", file[MG_PATH_MAX], path[MG_PATH_MAX];
|
||||
@@ -1079,11 +1075,11 @@ static void http_cb(struct mg_connection *c, int ev, void *ev_data) {
|
||||
static void mg_hfn(struct mg_connection *c, int ev, void *ev_data) {
|
||||
if (ev == MG_EV_HTTP_MSG) {
|
||||
struct mg_http_message *hm = (struct mg_http_message *) ev_data;
|
||||
if (mg_http_match_uri(hm, "/quit")) {
|
||||
if (mg_match(hm->uri, mg_str("/quit"), NULL)) {
|
||||
mg_http_reply(c, 200, "", "ok\n");
|
||||
c->is_draining = 1;
|
||||
c->data[0] = 'X';
|
||||
} else if (mg_http_match_uri(hm, "/debug")) {
|
||||
} else if (mg_match(hm->uri, mg_str("/debug"), NULL)) {
|
||||
int level = (int) mg_json_get_long(hm->body, "$.level", MG_LL_DEBUG);
|
||||
mg_log_set(level);
|
||||
mg_http_reply(c, 200, "", "Debug level set to %d\n", level);
|
||||
|
||||
@@ -57,7 +57,6 @@ int mg_http_get_var(const struct mg_str *, const char *name, char *, size_t);
|
||||
int mg_url_decode(const char *s, size_t n, char *to, size_t to_len, int form);
|
||||
size_t mg_url_encode(const char *s, size_t n, char *buf, size_t len);
|
||||
void mg_http_creds(struct mg_http_message *, char *, size_t, char *, size_t);
|
||||
bool mg_http_match_uri(const struct mg_http_message *, const char *glob);
|
||||
long mg_http_upload(struct mg_connection *c, struct mg_http_message *hm,
|
||||
struct mg_fs *fs, const char *dir, size_t max_size);
|
||||
void mg_http_bauth(struct mg_connection *, const char *user, const char *pass);
|
||||
|
||||
Reference in new issue
Block a user