summaryrefslogtreecommitdiffstats
path: root/src/server/events/Disconnect.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-07-26 15:27:03 +0000
committerDavid Robillard <d@drobilla.net>2012-07-26 15:27:03 +0000
commit3c5931bb13b5f88edcebb375fa6964dde8b85563 (patch)
tree9801897576b7fb9d8a9f700847c670f216fc93b7 /src/server/events/Disconnect.cpp
parentb83ed4f83cf4c9b5054dcf55bea710313c369633 (diff)
downloadingen-3c5931bb13b5f88edcebb375fa6964dde8b85563.tar.gz
ingen-3c5931bb13b5f88edcebb375fa6964dde8b85563.tar.bz2
ingen-3c5931bb13b5f88edcebb375fa6964dde8b85563.zip
Report subject with errors to client for more meaningful error messages.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4556 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/events/Disconnect.cpp')
-rw-r--r--src/server/events/Disconnect.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/server/events/Disconnect.cpp b/src/server/events/Disconnect.cpp
index 3ad9f650..00e4b374 100644
--- a/src/server/events/Disconnect.cpp
+++ b/src/server/events/Disconnect.cpp
@@ -119,14 +119,16 @@ Disconnect::pre_process()
if (_tail_path.parent().parent() != _head_path.parent().parent()
&& _tail_path.parent() != _head_path.parent().parent()
&& _tail_path.parent().parent() != _head_path.parent()) {
- return Event::pre_process_done(PARENT_DIFFERS);
+ return Event::pre_process_done(PARENT_DIFFERS, _head_path);
}
_tail = _engine.engine_store()->find_port(_tail_path);
_head = _engine.engine_store()->find_port(_head_path);
- if (_tail == NULL || _head == NULL) {
- return Event::pre_process_done(PORT_NOT_FOUND);
+ if (!_tail) {
+ return Event::pre_process_done(PORT_NOT_FOUND, _tail_path);
+ } else if (!_head) {
+ return Event::pre_process_done(PORT_NOT_FOUND, _head_path);
}
NodeImpl* const src_node = _tail->parent_node();
@@ -151,11 +153,11 @@ Disconnect::pre_process()
assert(_patch);
if (!_patch->has_edge(_tail, _head)) {
- return Event::pre_process_done(NOT_FOUND);
+ return Event::pre_process_done(NOT_FOUND, _head_path);
}
if (src_node == NULL || dst_node == NULL) {
- return Event::pre_process_done(PARENT_NOT_FOUND);
+ return Event::pre_process_done(PARENT_NOT_FOUND, _head_path);
}
_impl = new Impl(_engine,
@@ -214,8 +216,7 @@ Disconnect::execute(ProcessContext& context)
void
Disconnect::post_process()
{
- respond(_status);
- if (!_status) {
+ if (!respond()) {
_engine.broadcaster()->disconnect(_tail->path(), _head->path());
}