diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2010-11-14 09:27:28 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2010-11-14 09:27:28 +0000 |
commit | 2c7009b5200ff5b7462b56239c909daef8ed7910 (patch) | |
tree | 40b116d31a3c7f56540d12ed05a5b80f3e7c4ef3 /sca-cpp/trunk/modules/http | |
parent | efccdd821b68280ee3b73c8ef5cda121bc27f620 (diff) |
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
Diffstat (limited to '')
-rw-r--r-- | sca-cpp/trunk/modules/http/curl-connect.cpp | 10 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/http/http.hpp | 18 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/http/httpd.hpp | 2 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/http/mod-ssltunnel.cpp | 4 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/http/openauth.hpp | 2 |
5 files changed, 18 insertions, 18 deletions
diff --git a/sca-cpp/trunk/modules/http/curl-connect.cpp b/sca-cpp/trunk/modules/http/curl-connect.cpp index 8957fb01b0..432ccc2000 100644 --- a/sca-cpp/trunk/modules/http/curl-connect.cpp +++ b/sca-cpp/trunk/modules/http/curl-connect.cpp @@ -60,8 +60,8 @@ const bool testConnect(const string& url, const string& ca = "", const string& c if (pollfds->rtnevents & APR_POLLIN) { char data[8192]; if (pollfds->desc.s == csock) { - const int rl = ::read(0, data, sizeof(data)); - if (rl == -1) + const size_t rl = ::read(0, data, sizeof(data)); + if (rl == (size_t)-1) return false; if (rl > 0) { const failable<bool> src = http::send(data, rl, cs); @@ -69,12 +69,12 @@ const bool testConnect(const string& url, const string& ca = "", const string& c } } else { - const failable<int> frl = http::recv(data, sizeof(data), cs); + const failable<size_t> frl = http::recv(data, sizeof(data), cs); assert(hasContent(frl)); - const int rl = content(frl); + const size_t rl = content(frl); if (rl == 0) return true; - const int wl = ::write(0, data, rl); + const size_t wl = ::write(0, data, rl); assert(wl == rl); } continue; diff --git a/sca-cpp/trunk/modules/http/http.hpp b/sca-cpp/trunk/modules/http/http.hpp index 56331d7ee2..b6ec9d4e5a 100644 --- a/sca-cpp/trunk/modules/http/http.hpp +++ b/sca-cpp/trunk/modules/http/http.hpp @@ -94,8 +94,8 @@ private: friend CURL* handle(const CURLSession& cs); friend apr_socket_t* sock(const CURLSession& cs); friend const failable<bool> connect(const string& url, CURLSession& cs); - friend const failable<bool> send(const char* c, const int l, const CURLSession& cs); - friend const failable<int> recv(char* c, const int l, const CURLSession& cs); + friend const failable<bool> send(const char* c, const size_t l, const CURLSession& cs); + friend const failable<size_t> recv(char* c, const size_t l, const CURLSession& cs); public: string ca; @@ -257,7 +257,7 @@ template<typename R> const failable<list<R> > apply(const list<list<string> >& h ostringstream os; write(cadr(hdr), os); const string s = str(os); - const int sz = length(s); + const size_t sz = length(s); // Setup the read, write header and write data callbacks CURLReadContext rcx(mklist(s)); @@ -564,7 +564,7 @@ const failable<bool> connect(const string& url, CURLSession& cs) { /** * Send an array of chars. */ -const failable<bool> send(const char* c, const int l, const CURLSession& cs) { +const failable<bool> send(const char* c, const size_t l, const CURLSession& cs) { // Send the data size_t wl = 0; @@ -582,30 +582,30 @@ const failable<bool> send(const char* c, const int l, const CURLSession& cs) { return mkfailure<bool>(apreason(pollrc)); // Send what's left - return send(c + wl, (int)((size_t)l - wl), cs); + return send(c + wl, l - wl, cs); } /** * Receive an array of chars. */ -const failable<int> recv(char* c, const int l, const CURLSession& cs) { +const failable<size_t> recv(char* c, const size_t l, const CURLSession& cs) { // Receive data size_t rl; const CURLcode rc = curl_easy_recv(cs.h, c, (size_t)l, &rl); if (rc == CURLE_OK) - return (int)rl; + return (size_t)rl; if (rc == 1) return 0; if (rc != CURLE_AGAIN) - return mkfailure<int>(curlreason(rc)); + return mkfailure<size_t>(curlreason(rc)); // If the socket was not ready, wait for it to become ready const apr_pollfd_t* pollfds; apr_int32_t pollcount; apr_status_t pollrc = apr_pollset_poll(cs.rpollset, -1, &pollcount, &pollfds); if (pollrc != APR_SUCCESS) - return mkfailure<int>(apreason(pollrc)); + return mkfailure<size_t>(apreason(pollrc)); // Receive again return recv(c, l, cs); diff --git a/sca-cpp/trunk/modules/http/httpd.hpp b/sca-cpp/trunk/modules/http/httpd.hpp index 02c9904ac3..78d292dc89 100644 --- a/sca-cpp/trunk/modules/http/httpd.hpp +++ b/sca-cpp/trunk/modules/http/httpd.hpp @@ -328,7 +328,7 @@ const int setupReadPolicy(request_rec* r) { */ const list<string> read(request_rec* r) { char b[1024]; - const int n = ap_get_client_block(r, b, sizeof(b)); + const size_t n = ap_get_client_block(r, b, sizeof(b)); if (n <= 0) return list<string>(); return cons(string(b, n), read(r)); diff --git a/sca-cpp/trunk/modules/http/mod-ssltunnel.cpp b/sca-cpp/trunk/modules/http/mod-ssltunnel.cpp index c241cd982d..f5539ce785 100644 --- a/sca-cpp/trunk/modules/http/mod-ssltunnel.cpp +++ b/sca-cpp/trunk/modules/http/mod-ssltunnel.cpp @@ -203,10 +203,10 @@ int tunnel(conn_rec* conn, http::CURLSession& cs, const string& url, const strin // Receive from target char data[8192]; - const failable<int> frl = http::recv(data, sizeof(data), cs); + const failable<size_t> frl = http::recv(data, sizeof(data), cs); if (!hasContent(frl)) return abort(conn, string("Couldn't receive from target") + reason(frl)); - const int rl = content(frl); + const size_t rl = content(frl); // Target connection closed if (rl == 0) diff --git a/sca-cpp/trunk/modules/http/openauth.hpp b/sca-cpp/trunk/modules/http/openauth.hpp index 53250b4732..ff69a9732f 100644 --- a/sca-cpp/trunk/modules/http/openauth.hpp +++ b/sca-cpp/trunk/modules/http/openauth.hpp @@ -51,7 +51,7 @@ const maybe<string> sessionID(const list<string> c) { if (isNil(c)) return maybe<string>(); const string cn = cookieName(c_str(car(c))); - const int i = find(cn, "="); + const size_t i = find(cn, "="); if (i < length(cn)) { const list<string> kv = mklist<string>(substr(cn, 0, i), substr(cn, i+1)); if (!isNil(kv) && !isNil(cdr(kv))) { |