X-Git-Url: http://git.archive.openwrt.org/?p=project%2Flibubox.git;a=blobdiff_plain;f=examples%2Fustream-example.c;h=3db56c443e0f9eb67bc3d3b75c099445522de2f3;hp=68611c6fb0ad7ad2eaf944bf3f375cfa98ddb568;hb=db8e7060e057d5794ed1604a45d5df75946d55cb;hpb=15ce77677281a91b7a26b693a129a92997d3d6bc diff --git a/examples/ustream-example.c b/examples/ustream-example.c index 68611c6..3db56c4 100644 --- a/examples/ustream-example.c +++ b/examples/ustream-example.c @@ -5,6 +5,7 @@ #include #include #include +#include #include "ustream.h" #include "uloop.h" @@ -23,7 +24,7 @@ struct client { static void client_read_cb(struct ustream *s, int bytes) { - struct client *cl = container_of(s, struct client, s); + struct client *cl = container_of(s, struct client, s.stream); struct ustream_buf *buf = s->r.head; char *newline, *str; @@ -50,7 +51,7 @@ static void client_read_cb(struct ustream *s, int bytes) static void client_close(struct ustream *s) { - struct client *cl = container_of(s, struct client, s); + struct client *cl = container_of(s, struct client, s.stream); fprintf(stderr, "Connection closed\n"); ustream_free(s); @@ -70,7 +71,7 @@ static void client_notify_write(struct ustream *s, int bytes) static void client_notify_state(struct ustream *s) { - struct client *cl = container_of(s, struct client, s); + struct client *cl = container_of(s, struct client, s.stream); if (!s->eof) return;