diff options
author | David Robillard <d@drobilla.net> | 2010-01-07 05:30:58 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-01-07 05:30:58 +0000 |
commit | 2cd6cbac63b4eafde20698e918151b27908fd335 (patch) | |
tree | 82790b280d3a9d1f1c82bf11c8111c59a5b88032 /src/client/HTTPClientReceiver.cpp | |
parent | 1de7af2e453735869122ca61f65be157d7b799bd (diff) | |
download | ingen-2cd6cbac63b4eafde20698e918151b27908fd335.tar.gz ingen-2cd6cbac63b4eafde20698e918151b27908fd335.tar.bz2 ingen-2cd6cbac63b4eafde20698e918151b27908fd335.zip |
Better log output.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2361 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/client/HTTPClientReceiver.cpp')
-rw-r--r-- | src/client/HTTPClientReceiver.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/client/HTTPClientReceiver.cpp b/src/client/HTTPClientReceiver.cpp index 9545bbe6..308b631b 100644 --- a/src/client/HTTPClientReceiver.cpp +++ b/src/client/HTTPClientReceiver.cpp @@ -61,16 +61,11 @@ HTTPClientReceiver::~HTTPClientReceiver() } -HTTPClientReceiver::Listener::~Listener() -{ - close(_sock); -} - HTTPClientReceiver::Listener::Listener(HTTPClientReceiver* receiver, const std::string uri) : _uri(uri) , _receiver(receiver) { - string port_str = uri.substr(uri.find_last_of(":")+1); + const string port_str = uri.substr(uri.find_last_of(":")+1); int port = atoi(port_str.c_str()); LOG(info) << "Client HTTP listen: " << uri << " (port " << port << ")" << endl; @@ -105,12 +100,20 @@ HTTPClientReceiver::Listener::Listener(HTTPClientReceiver* receiver, const std:: } +HTTPClientReceiver::Listener::~Listener() +{ + close(_sock); +} + void HTTPClientReceiver::send(SoupMessage* msg) { - if (!client_session) + if (!client_session) { + LOG(debug) << "Starting session" << endl; client_session = soup_session_sync_new(); + } + assert(SOUP_IS_MESSAGE(msg)); soup_session_queue_message(client_session, msg, message_callback, client_receiver); } @@ -231,6 +234,7 @@ HTTPClientReceiver::start(bool dump) _world->load("ingen_serialisation"); SoupMessage* msg = soup_message_new("GET", (_url + "/stream").c_str()); + assert(SOUP_IS_MESSAGE(msg)); soup_session_queue_message(client_session, msg, message_callback, this); } |