summaryrefslogtreecommitdiffstats
path: root/src/server/Context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/Context.cpp')
-rw-r--r--src/server/Context.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/server/Context.cpp b/src/server/Context.cpp
index 3b07373d..20d78c0e 100644
--- a/src/server/Context.cpp
+++ b/src/server/Context.cpp
@@ -53,7 +53,7 @@ Context::Context(Engine& engine, ID id)
, _realtime(true)
{}
-void
+bool
Context::notify(LV2_URID key,
FrameTime time,
PortImpl* port,
@@ -63,14 +63,16 @@ Context::notify(LV2_URID key,
{
const Notification n(port, time, key, size, type);
if (_event_sink.write_space() < sizeof(n) + size) {
- _engine.log().warn("Notification ring overflow\n");
+ return false;
+ }
+ if (_event_sink.write(sizeof(n), &n) != sizeof(n)) {
+ _engine.log().error("Error writing header to notification ring\n");
+ } else if (_event_sink.write(size, body) != size) {
+ _engine.log().error("Error writing body to notification ring\n");
} else {
- if (_event_sink.write(sizeof(n), &n) != sizeof(n)) {
- _engine.log().error("Error writing header to notification ring\n");
- } else if (_event_sink.write(size, body) != size) {
- _engine.log().error("Error writing body to notification ring\n");
- }
+ return true;
}
+ return false;
}
void