From a9b44ebe556c3f60de2fc1154d48a26f43aa15b7 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 30 Oct 2012 00:00:57 +0100 Subject: [PATCH] ustream: make notify_state optional as well --- ustream.c | 3 ++- ustream.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ustream.c b/ustream.c index ed4fbb3..8e6efcd 100644 --- a/ustream.c +++ b/ustream.c @@ -104,7 +104,8 @@ static void ustream_state_change_cb(struct uloop_timeout *t) if (s->write_error) ustream_free_buffers(&s->w); - s->notify_state(s); + if (s->notify_state) + s->notify_state(s); } void ustream_init_defaults(struct ustream *s) diff --git a/ustream.h b/ustream.h index 634a3e7..2df429c 100644 --- a/ustream.h +++ b/ustream.h @@ -68,7 +68,7 @@ struct ustream { void (*notify_write)(struct ustream *s, int bytes); /* - * notify_state: + * notify_state: (optional) * called by the ustream implementation to notify that the read * side of the stream is closed (eof is set) or there was a write * error (write_error is set).