projects
/
project
/
libubox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
efc9f4b
)
ustream: make notify_state optional as well
author
Felix Fietkau
<nbd@openwrt.org>
Mon, 29 Oct 2012 23:00:57 +0000
(
00:00
+0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Mon, 29 Oct 2012 23:00:57 +0000
(
00:00
+0100)
ustream.c
patch
|
blob
|
history
ustream.h
patch
|
blob
|
history
diff --git
a/ustream.c
b/ustream.c
index ed4fbb381fa14aec095c6375e70ba0f590442ab3..8e6efcda43be5eca12d2dc8b4c131928be9d9123 100644
(file)
--- 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 634a3e7e41b9e7931cc1f17841f1246fff4e6a8c..2df429c0a165a341ca83ec557c3e6d760600fe94 100644
(file)
--- 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).