diff options
author | David Robillard <d@drobilla.net> | 2008-11-16 05:34:01 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-11-16 05:34:01 +0000 |
commit | 0fd3c583e032a3cd5af877902d4561a45179a232 (patch) | |
tree | e6bc62875842fda0908f1aea3a51b67740825d71 /src/shared | |
parent | 24d998447070dbfef3eaf7762dce7e97c3903801 (diff) | |
download | ingen-0fd3c583e032a3cd5af877902d4561a45179a232.tar.gz ingen-0fd3c583e032a3cd5af877902d4561a45179a232.tar.bz2 ingen-0fd3c583e032a3cd5af877902d4561a45179a232.zip |
Follow new object creation via HTTP (serialising/parsing RDF to communicate between client and engine).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1722 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/ClashAvoider.cpp | 9 | ||||
-rw-r--r-- | src/shared/ClashAvoider.hpp | 2 | ||||
-rw-r--r-- | src/shared/HTTPSender.cpp | 15 |
3 files changed, 18 insertions, 8 deletions
diff --git a/src/shared/ClashAvoider.cpp b/src/shared/ClashAvoider.cpp index ca322b74..aa7dd774 100644 --- a/src/shared/ClashAvoider.cpp +++ b/src/shared/ClashAvoider.cpp @@ -127,6 +127,15 @@ ClashAvoider::exists(const Raul::Path& path) const void +ClashAvoider::new_object(const GraphObject* object) +{ + // FIXME: + ((GraphObject*)object)->set_path(map_path(object->path())); + _target.new_object(object); +} + + +void ClashAvoider::new_patch(const std::string& path, uint32_t poly) { diff --git a/src/shared/ClashAvoider.hpp b/src/shared/ClashAvoider.hpp index ac2d62bb..ead6d96c 100644 --- a/src/shared/ClashAvoider.hpp +++ b/src/shared/ClashAvoider.hpp @@ -49,6 +49,8 @@ public: // Object commands + void new_object(const GraphObject* object); + void new_patch(const std::string& path, uint32_t poly); diff --git a/src/shared/HTTPSender.cpp b/src/shared/HTTPSender.cpp index 7f760786..1b38f97f 100644 --- a/src/shared/HTTPSender.cpp +++ b/src/shared/HTTPSender.cpp @@ -109,8 +109,9 @@ HTTPSender::_run() _signal.wait(_mutex); write(_client_sock, _transfer.c_str(), _transfer.length()); - write(_client_sock, "\n\n", 2); + write(_client_sock, "\n\n\n", 2); + _signal.broadcast(); _mutex.unlock(); } @@ -125,16 +126,15 @@ HTTPSender::bundle_begin() _mutex.lock(); _send_state = SendingBundle; _transfer = ""; - _mutex.unlock(); } void HTTPSender::bundle_end() { - _mutex.lock(); assert(_send_state == SendingBundle); _signal.broadcast(); + _signal.wait(_mutex); _send_state = Immediate; _mutex.unlock(); } @@ -143,16 +143,15 @@ HTTPSender::bundle_end() void HTTPSender::send_chunk(const std::string& buf) { - _mutex.lock(); - if (_send_state == Immediate) { - _transfer = ""; + _mutex.lock(); + _transfer = buf; _signal.broadcast(); + _signal.wait(_mutex); + _mutex.unlock(); } else { _transfer.append(buf); } - - _mutex.unlock(); } |