diff options
author | David Robillard <d@drobilla.net> | 2012-03-12 02:28:21 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-03-12 02:28:21 +0000 |
commit | e9d9569271ee962c09ab66c6babed1ca5655a6c6 (patch) | |
tree | f77142b08c2bf2488eb382e993da1477c0b94307 /src/http | |
parent | 7835b3d8c9b5b4a6f4959f56083d62826e6f7b8e (diff) | |
download | ingen-e9d9569271ee962c09ab66c6babed1ca5655a6c6.tar.gz ingen-e9d9569271ee962c09ab66c6babed1ca5655a6c6.tar.bz2 ingen-e9d9569271ee962c09ab66c6babed1ca5655a6c6.zip |
Unify event response mechanism and make it more appropriate for wire transmission.
The downside being more cryptic error messages until the client side error reporting stuff gets more fancy, but the important part is that belongs client side.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4053 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/http')
-rw-r--r-- | src/http/HTTPClientReceiver.cpp | 6 | ||||
-rw-r--r-- | src/http/HTTPClientSender.cpp | 12 | ||||
-rw-r--r-- | src/http/HTTPClientSender.hpp | 3 |
3 files changed, 9 insertions, 12 deletions
diff --git a/src/http/HTTPClientReceiver.cpp b/src/http/HTTPClientReceiver.cpp index dc1235e7..bb4b9c3b 100644 --- a/src/http/HTTPClientReceiver.cpp +++ b/src/http/HTTPClientReceiver.cpp @@ -166,14 +166,14 @@ HTTPClientReceiver::message_callback(SoupSession* session, SoupMessage* msg, voi } if (path == "/") { - me->_target->response_ok(0); + me->_target->response(0, SUCCESS); } else if (path == "/plugins") { if (msg->response_body->data == NULL) { LOG(error) << "Empty response" << endl; } else { Glib::Mutex::Lock lock(me->_mutex); - me->_target->response_ok(0); + me->_target->response(0, SUCCESS); me->_world->parser()->parse_string(me->_world, me->_target.get(), Glib::ustring(msg->response_body->data), me->_url); } @@ -183,7 +183,7 @@ HTTPClientReceiver::message_callback(SoupSession* session, SoupMessage* msg, voi LOG(error) << "Empty response" << endl; } else { Glib::Mutex::Lock lock(me->_mutex); - me->_target->response_ok(0); + me->_target->response(0, SUCCESS); me->_world->parser()->parse_string( me->_world, me->_target.get(), diff --git a/src/http/HTTPClientSender.cpp b/src/http/HTTPClientSender.cpp index 979d1e64..ea983ca4 100644 --- a/src/http/HTTPClientSender.cpp +++ b/src/http/HTTPClientSender.cpp @@ -36,14 +36,12 @@ namespace Ingen { namespace Server { void -HTTPClientSender::response_ok(int32_t id) +HTTPClientSender::response(int32_t id, Status status) { -} - -void -HTTPClientSender::response_error(int32_t id, const std::string& msg) -{ - warn << "HTTP Error " << id << " (" << msg << ")" << endl; + if (status) { + warn << "HTTP Error " << id + << " (" << ingen_status_string(status) << ")" << endl; + } } void diff --git a/src/http/HTTPClientSender.hpp b/src/http/HTTPClientSender.hpp index 761a60a6..c0af96df 100644 --- a/src/http/HTTPClientSender.hpp +++ b/src/http/HTTPClientSender.hpp @@ -63,8 +63,7 @@ public: /* *** ClientInterface Implementation Below *** */ - void response_ok(int32_t id); - void response_error(int32_t id, const std::string& msg); + void response(int32_t id, Status status); void error(const std::string& msg); |