From b56e985ccccd82c3743dc9cf116b0a468205e27c Mon Sep 17 00:00:00 2001 From: Alexander Alashkin <alexander.alashkin@cesanta.com> Date: Wed, 13 Jan 2016 18:45:09 +0100 Subject: [PATCH] Use mg_parse_uri in ws, add mg_mk_str function PUBLISHED_FROM=650ce03aaf53f4c501fbb77a3ae0b584278e299a --- mongoose.c | 5 +++++ mongoose.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/mongoose.c b/mongoose.c index acecdfb16..171632004 100644 --- a/mongoose.c +++ b/mongoose.c @@ -7115,6 +7115,11 @@ int mg_match_prefix(const char *pattern, int pattern_len, const char *str) { } return j; } + +struct mg_str mg_mk_str(const char *s) { + struct mg_str ret = {s, strlen(s)}; + return ret; +} #ifdef NS_MODULE_LINES #line 1 "./src/json-rpc.c" /**/ diff --git a/mongoose.h b/mongoose.h index e7ad6fb0a..5defa1856 100644 --- a/mongoose.h +++ b/mongoose.h @@ -1475,6 +1475,9 @@ const char *mg_next_comma_list_entry(const char *list, struct mg_str *val, */ int mg_match_prefix(const char *pattern, int pattern_len, const char *str); +/* A helper function for creating mg_str struct from plain C string */ +struct mg_str mg_mk_str(const char *s); + #ifdef __cplusplus } #endif /* __cplusplus */ -- GitLab