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/http.hpp | |
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 'sca-cpp/trunk/modules/http/http.hpp')
-rw-r--r-- | sca-cpp/trunk/modules/http/http.hpp | 18 |
1 files changed, 9 insertions, 9 deletions
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); |