summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-04-19 22:01:49 +0000
committerDavid Robillard <d@drobilla.net>2011-04-19 22:01:49 +0000
commita90f32d9aef9c93e308de560a975e81c3c86b343 (patch)
tree3fa6e76679297a61d961659b95d46734f8e861c8 /src/client
parent74c76bd82792b03bd12f30aa875fae3e5047ccc2 (diff)
downloadingen-a90f32d9aef9c93e308de560a975e81c3c86b343.tar.gz
ingen-a90f32d9aef9c93e308de560a975e81c3c86b343.tar.bz2
ingen-a90f32d9aef9c93e308de560a975e81c3c86b343.zip
Partially fix HTTP.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3173 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/client')
-rw-r--r--src/client/HTTPClientReceiver.cpp10
-rw-r--r--src/client/HTTPEngineSender.cpp18
2 files changed, 21 insertions, 7 deletions
diff --git a/src/client/HTTPClientReceiver.cpp b/src/client/HTTPClientReceiver.cpp
index 2b9b2cce..ce4c2384 100644
--- a/src/client/HTTPClientReceiver.cpp
+++ b/src/client/HTTPClientReceiver.cpp
@@ -190,15 +190,17 @@ HTTPClientReceiver::message_callback(SoupSession* session, SoupMessage* msg, voi
Glib::ustring(msg->response_body->data), me->_url);
}
- } else if (path == "/patch") {
+ } else if (path.substr(0, 6) == "/patch") {
if (msg->response_body->data == NULL) {
LOG(error) << "Empty response" << endl;
} else {
Glib::Mutex::Lock lock(me->_mutex);
me->_target->response_ok(0);
- me->_world->parser()->parse_string(me->_world, me->_target.get(),
- Glib::ustring(msg->response_body->data),
- Glib::ustring("/patch/"));
+ me->_world->parser()->parse_string(
+ me->_world,
+ me->_target.get(),
+ Glib::ustring(msg->response_body->data),
+ path);
}
} else if (path == "/stream") {
diff --git a/src/client/HTTPEngineSender.cpp b/src/client/HTTPEngineSender.cpp
index 98c43a12..ceb60162 100644
--- a/src/client/HTTPEngineSender.cpp
+++ b/src/client/HTTPEngineSender.cpp
@@ -106,7 +106,7 @@ HTTPEngineSender::delta(const Raul::URI& path,
const Resource::Properties& remove,
const Resource::Properties& add)
{
- warn << "FIXME: HTTP DELTA" << endl;
+ LOG(warn) << "TODO: HTTP delta" << endl;
}
void
@@ -133,18 +133,21 @@ void
HTTPEngineSender::connect(const Path& src_port_path,
const Path& dst_port_path)
{
+ LOG(warn) << "TODO: HTTP connect" << endl;
}
void
HTTPEngineSender::disconnect(const Path& src_port_path,
const Path& dst_port_path)
{
+ LOG(warn) << "TODO: HTTP disconnect" << endl;
}
void
HTTPEngineSender::disconnect_all(const Path& parent_patch_path,
const Path& path)
{
+ LOG(warn) << "TODO: HTTP disconnect_all" << endl;
}
void
@@ -169,8 +172,17 @@ HTTPEngineSender::ping()
void
HTTPEngineSender::get(const URI& uri)
{
- LOG(debug) << "Get " << _engine_url << endl;
- SoupMessage* msg = soup_message_new("GET", uri.c_str());
+ if (!Raul::Path::is_path(uri) && uri.scheme() != "http") {
+ LOG(warn) << "Ignoring GET of non-HTTP URI " << uri << endl;
+ return;
+ }
+
+ const std::string request_uri = (Raul::Path::is_path(uri))
+ ?_engine_url.str() + "/patch" + uri.substr(uri.find("/"))
+ : uri.str();
+ cout << "Get " << request_uri << endl;
+ LOG(debug) << "Get " << request_uri << endl;
+ SoupMessage* msg = soup_message_new("GET", request_uri.c_str());
HTTPClientReceiver::send(msg);
}