fix relay ustream initialization
authorFelix Fietkau <nbd@openwrt.org>
Thu, 3 Jan 2013 14:54:57 +0000 (15:54 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Fri, 4 Jan 2013 16:00:12 +0000 (17:00 +0100)
relay.c

diff --git a/relay.c b/relay.c
index f484aa46f07f5addee495e3fa01c8503713b4611..81e7736c06187f4028d71bd3a5774f62258b161b 100644 (file)
--- a/relay.c
+++ b/relay.c
@@ -166,10 +166,10 @@ void uh_relay_open(struct client *cl, struct relay *r, int fd, int pid)
        struct ustream *us = &r->sfd.stream;
 
        r->cl = cl;
-       ustream_fd_init(&r->sfd, fd);
        us->notify_read = relay_read_cb;
        us->notify_state = relay_state_cb;
        us->string_data = true;
+       ustream_fd_init(&r->sfd, fd);
 
        r->proc.pid = pid;
        r->proc.cb = relay_proc_cb;