diff options
Diffstat (limited to 'sca-cpp/trunk/components/chat')
-rw-r--r-- | sca-cpp/trunk/components/chat/chat-sender.cpp | 6 | ||||
-rw-r--r-- | sca-cpp/trunk/components/chat/chat-sender2.cpp | 6 | ||||
-rw-r--r-- | sca-cpp/trunk/components/chat/chat-sendreceiver.cpp | 6 | ||||
-rwxr-xr-x | sca-cpp/trunk/components/chat/server-test | 1 | ||||
-rwxr-xr-x | sca-cpp/trunk/components/chat/vysper-stop | 5 | ||||
-rw-r--r-- | sca-cpp/trunk/components/chat/xmpp.hpp | 4 |
6 files changed, 16 insertions, 12 deletions
diff --git a/sca-cpp/trunk/components/chat/chat-sender.cpp b/sca-cpp/trunk/components/chat/chat-sender.cpp index 5e289d7eac..0672292a06 100644 --- a/sca-cpp/trunk/components/chat/chat-sender.cpp +++ b/sca-cpp/trunk/components/chat/chat-sender.cpp @@ -46,7 +46,7 @@ const failable<value> post(const list<value>& params, XMPPClient& xc) { debug(val, "chat::post::value"); const failable<bool> r = post(to, val, xc); if (!hasContent(r)) - return mkfailure<value>(reason(r)); + return mkfailure<value>(r); return value(mklist<value>(to)); } @@ -96,7 +96,7 @@ public: // Stop the chat sender component if (func != "stop") - return tuscany::mkfailure<tuscany::value>(); + return mkfailure<value>(); debug("chat::sender::stop"); // Disconnect and shutdown the worker thread @@ -125,7 +125,7 @@ const failable<value> start(const list<value>& params) { XMPPClient xc(jid, pass, false); const failable<bool> r = connect(xc); if (!hasContent(r)) - return mkfailure<value>(reason(r)); + return mkfailure<value>(r); // Listen and relay messages in a worker thread worker w(3); diff --git a/sca-cpp/trunk/components/chat/chat-sender2.cpp b/sca-cpp/trunk/components/chat/chat-sender2.cpp index 05dec36270..b230d130c1 100644 --- a/sca-cpp/trunk/components/chat/chat-sender2.cpp +++ b/sca-cpp/trunk/components/chat/chat-sender2.cpp @@ -55,12 +55,12 @@ const failable<value> post(const lambda<value(const list<value>&)> jid, const la XMPPClient xc(vjid, vpass); const failable<bool> c = connect(xc); if (!hasContent(c)) - return mkfailure<value>(reason(c)); + return mkfailure<value>(c); // Post the message const failable<bool> r = post(vto, vmsg, xc); if (!hasContent(r)) - return mkfailure<value>(reason(r)); + return mkfailure<value>(r); return value(mklist<value>(vto)); } @@ -79,7 +79,7 @@ public: // Stop the chat sender component if (func != "stop") - return tuscany::mkfailure<tuscany::value>(); + return mkfailure<value>(); debug("chat::sender::stop"); return failable<value>(value(lambda<value(const list<value>&)>())); } diff --git a/sca-cpp/trunk/components/chat/chat-sendreceiver.cpp b/sca-cpp/trunk/components/chat/chat-sendreceiver.cpp index ddc12bb164..aac8d69f6c 100644 --- a/sca-cpp/trunk/components/chat/chat-sendreceiver.cpp +++ b/sca-cpp/trunk/components/chat/chat-sendreceiver.cpp @@ -46,7 +46,7 @@ const failable<value> post(const list<value>& params, XMPPClient& xc) { debug(val, "chat::post::value"); const failable<bool> r = post(to, val, xc); if (!hasContent(r)) - return mkfailure<value>(reason(r)); + return mkfailure<value>(r); return value(mklist<value>(to)); } @@ -107,7 +107,7 @@ public: // Stop the chat sender/receiver component if (func != "stop") - return tuscany::mkfailure<tuscany::value>(); + return mkfailure<value>(); debug("chat::sendreceiver::stop"); // Disconnect and shutdown the worker thread @@ -138,7 +138,7 @@ const failable<value> start(const list<value>& params) { XMPPClient xc(jid, pass, false); const failable<bool> r = connect(xc); if (!hasContent(r)) - return mkfailure<value>(reason(r)); + return mkfailure<value>(r); // Listen and relay messages in a worker thread worker w(3); diff --git a/sca-cpp/trunk/components/chat/server-test b/sca-cpp/trunk/components/chat/server-test index 4b3a7bfc6a..7b5fabfe14 100755 --- a/sca-cpp/trunk/components/chat/server-test +++ b/sca-cpp/trunk/components/chat/server-test @@ -18,6 +18,7 @@ # under the License. # Setup +rm -rf tmp ../../modules/http/httpd-conf tmp localhost 8090 ../../modules/http/htdocs ../../modules/http/httpd-event-conf tmp ../../modules/server/server-conf tmp diff --git a/sca-cpp/trunk/components/chat/vysper-stop b/sca-cpp/trunk/components/chat/vysper-stop index 6ae9246134..0fec98400d 100755 --- a/sca-cpp/trunk/components/chat/vysper-stop +++ b/sca-cpp/trunk/components/chat/vysper-stop @@ -21,5 +21,8 @@ here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` java_prefix=`cat $here/../../modules/java/java.prefix` -kill `ps -ef | grep -v grep | grep "${java_prefix}/jre/bin/java" | grep "vysper" | awk '{ print $2 }'` +k=`ps -ef | grep -v grep | grep "${java_prefix}/jre/bin/java" | grep "vysper" | awk '{ print $2 }'` +if [ "$k" != "" ]; then + kill $k +fi diff --git a/sca-cpp/trunk/components/chat/xmpp.hpp b/sca-cpp/trunk/components/chat/xmpp.hpp index cafe342f05..e5f423c270 100644 --- a/sca-cpp/trunk/components/chat/xmpp.hpp +++ b/sca-cpp/trunk/components/chat/xmpp.hpp @@ -291,7 +291,7 @@ const failable<bool> post(const value& to, const value& val, XMPPClient& xc) { const failable<size_t> r = send(stanza, xc); xmpp_stanza_release(stanza); if (!hasContent(r)) - return mkfailure<bool>(reason(r)); + return mkfailure<bool>(r); return true; } @@ -302,7 +302,7 @@ const failable<bool> disconnect(XMPPClient& xc) { xc.disconnecting = true; const failable<size_t> r = send("</stream:stream>", xc); if (!hasContent(r)) - return mkfailure<bool>(reason(r)); + return mkfailure<bool>(r); return true; } |