From 2c7009b5200ff5b7462b56239c909daef8ed7910 Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Sun, 14 Nov 2010 09:27:28 +0000 Subject: Port to Ubuntu server 10.10 64-bit. C++ code fixes required to compile and run on 64-bit. Update INSTALL doc and build scripts. Remove a few obsolete scripts. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1034963 13f79535-47bb-0310-9956-ffa450edef68 --- sca-cpp/trunk/components/chat/xmpp.hpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'sca-cpp/trunk/components/chat') diff --git a/sca-cpp/trunk/components/chat/xmpp.hpp b/sca-cpp/trunk/components/chat/xmpp.hpp index a921b9806d..3a6aa86c5c 100644 --- a/sca-cpp/trunk/components/chat/xmpp.hpp +++ b/sca-cpp/trunk/components/chat/xmpp.hpp @@ -87,8 +87,8 @@ private: friend void connHandler(xmpp_conn_t * const conn, const xmpp_conn_event_t status, const int err, xmpp_stream_error_t* const errstream, void *const udata); friend int messageHandler(xmpp_conn_t* const conn, xmpp_stanza_t* const stanza, void* const udata); friend const failable connect(XMPPClient& xc); - friend const failable send(const char* data, const int len, XMPPClient& xc); - friend const failable send(xmpp_stanza_t* const stanza, XMPPClient& xc); + friend const failable send(const char* data, const size_t len, XMPPClient& xc); + friend const failable send(xmpp_stanza_t* const stanza, XMPPClient& xc); friend const failable post(const value& to, const value& val, XMPPClient& xc); friend const failable disconnect(XMPPClient& xc); friend const failable listen(const lambda(const value&, const value&, XMPPClient&)>& listener, XMPPClient& xc); @@ -227,13 +227,13 @@ const failable connect(XMPPClient& xc) { /** * Send a buffer on an XMPP session. */ -const failable send(const char* data, const int len, XMPPClient& xc) { +const failable send(const char* data, const size_t len, XMPPClient& xc) { if (len == 0) return 0; - const int written = xc.conn->tls? tls_write(xc.conn->tls, data, len) : sock_write(xc.conn->sock, data, len); - if (written < 0) { + const size_t written = xc.conn->tls? tls_write(xc.conn->tls, data, len) : sock_write(xc.conn->sock, data, len); + if (written == (size_t)-1) { xc.conn->error = xc.conn->tls? tls_error(xc.conn->tls) : sock_error(); - return mkfailure("Couldn't send stanza to XMPP server"); + return mkfailure("Couldn't send stanza to XMPP server"); } return send(data + written, len - written, xc); } @@ -241,20 +241,20 @@ const failable send(const char* data, const int len, XMPPClient& xc) { /** * Send a string on an XMPP session. */ -const failable send(const string& data, XMPPClient& xc) { +const failable send(const string& data, XMPPClient& xc) { return send(c_str(data), length(data), xc); } /** * Send a stanza on an XMPP session. */ -const failable send(xmpp_stanza_t* const stanza, XMPPClient& xc) { +const failable send(xmpp_stanza_t* const stanza, XMPPClient& xc) { char *buf; size_t len; const int rc = xmpp_stanza_to_text(stanza, &buf, &len); if (rc != 0) - return mkfailure("Couldn't convert stanza to text"); - const failable r = send(buf, len, xc); + return mkfailure("Couldn't convert stanza to text"); + const failable r = send(buf, len, xc); if (!hasContent(r)) { xmpp_free(xc.conn->ctx, buf); return r; @@ -283,7 +283,7 @@ const failable post(const value& to, const value& val, XMPPClient& xc) { xmpp_stanza_add_child(body, textStanza(c_str(vs), xc.ctx)); // Send it - const failable r = send(stanza, xc); + const failable r = send(stanza, xc); xmpp_stanza_release(stanza); if (!hasContent(r)) return mkfailure(reason(r)); @@ -295,7 +295,7 @@ const failable post(const value& to, const value& val, XMPPClient& xc) { */ const failable disconnect(XMPPClient& xc) { xc.disconnecting = true; - const failable r = send("", xc); + const failable r = send("", xc); if (!hasContent(r)) return mkfailure(reason(r)); return true; -- cgit v1.2.3