httpd: fix compilation: wip
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
diff --git a/http/http_event.c b/http/http_event.c
index fcb1154..3317dc9 100644
--- a/http/http_event.c
+++ b/http/http_event.c
@@ -70,6 +70,7 @@ struct event * http_event_new (s32 fd, const s_list *events,
{
const s_list *e;
struct event *ev;
+ s16 events_s16;
s_tag *tag;
ev = alloc(sizeof(*ev));
if (! ev)
@@ -80,16 +81,16 @@ struct event * http_event_new (s32 fd, const s_list *events,
if (e->tag.type != TAG_SYM)
goto invalid_event_list;
if (e->tag.data.sym == &g_sym_read)
- e |= EV_READ;
+ events_s16 |= EV_READ;
else if (e->tag.data.sym == &g_sym_write)
- e |= EV_WRITE;
+ events_s16 |= EV_WRITE;
else
goto invalid_event_list;
e = list_next(e);
}
tag = tag_new_tuple(2);
tag_init_fn_copy(tag->data.tuple.tag, callback);
- tag_init_copy(tag->data.tuple.tag + 1, tag);
+ tag_init_copy(tag->data.tuple.tag + 1, arg);
event_set(ev, fd, events_s16, http_event_callback, tag);
return ev;
invalid_event_list:
diff --git a/http/http_event.h b/http/http_event.h
index c6caf8b..685080a 100644
--- a/http/http_event.h
+++ b/http/http_event.h
@@ -17,7 +17,7 @@
/* Heap-allocation functions, call http_event_delete after use. */
void http_event_delete (struct event *ev);
-struct event * http_event_new (s32 fd, s_list *events, const s_fn *fn,
+struct event * http_event_new (s32 fd, const s_list *events, const s_fn *fn,
s_tag *arg);
s32 http_event_add (struct event *ev, s_time *time);