mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-27 12:26:24 +00:00
cleanup 'str' API
This commit is contained in:
1 parent
6c7672f4af
commit
3c531897b6
20 files changed
+350
-400
No files matched your search
@@ -5,7 +5,10 @@ void mg_rpc_add(struct mg_rpc **head, struct mg_str method,
|
||||
void (*fn)(struct mg_rpc_req *), void *fn_data) {
|
||||
struct mg_rpc *rpc = (struct mg_rpc *) calloc(1, sizeof(*rpc));
|
||||
if (rpc != NULL) {
|
||||
rpc->method = mg_strdup(method), rpc->fn = fn, rpc->fn_data = fn_data;
|
||||
rpc->method.buf = mg_mprintf("%.*s", method.len, method.buf);
|
||||
rpc->method.len = method.len;
|
||||
rpc->fn = fn;
|
||||
rpc->fn_data = fn_data;
|
||||
rpc->next = *head, *head = rpc;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user