parent
b5517eda7e
commit
c5ac8e8d8e
|
@ -29,7 +29,7 @@ int uh_add_action(struct uh_server *srv, const char *path, action_cb_t cb)
|
||||||
{
|
{
|
||||||
struct uh_action *a;
|
struct uh_action *a;
|
||||||
|
|
||||||
a = calloc(1, sizeof(struct uh_action));
|
a = calloc(1, sizeof(struct uh_action) + strlen(path) + 1);
|
||||||
if (!a) {
|
if (!a) {
|
||||||
uh_log_err("calloc");
|
uh_log_err("calloc");
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -28,8 +28,8 @@ typedef void (*action_cb_t)(struct uh_client *cl);
|
||||||
|
|
||||||
struct uh_action {
|
struct uh_action {
|
||||||
struct avl_node avl;
|
struct avl_node avl;
|
||||||
char path[PATH_MAX];
|
|
||||||
action_cb_t cb;
|
action_cb_t cb;
|
||||||
|
char path[0];
|
||||||
};
|
};
|
||||||
|
|
||||||
int uh_add_action(struct uh_server *srv, const char *path, action_cb_t cb);
|
int uh_add_action(struct uh_server *srv, const char *path, action_cb_t cb);
|
||||||
|
|
Loading…
Reference in New Issue