mirror of https://github.com/aria2/aria2
2009-05-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed compile error on Mac OS X * src/HttpServer.cc * src/XmlRpcMethod.h * src/XmlRpcMethodImpl.ccpull/1/head
parent
52312c7a31
commit
c3129fd4a4
|
@ -1,3 +1,10 @@
|
|||
2009-05-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Fixed compile error on Mac OS X
|
||||
* src/HttpServer.cc
|
||||
* src/XmlRpcMethod.h
|
||||
* src/XmlRpcMethodImpl.cc
|
||||
|
||||
2009-05-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Use std::binary_search instead of std::find
|
||||
|
|
|
@ -99,7 +99,9 @@ bool HttpServer::receiveBody()
|
|||
}
|
||||
const size_t BUFLEN = 4096;
|
||||
char buf[BUFLEN];
|
||||
size_t length = std::min(BUFLEN, _lastContentLength-_lastBody.tellg());
|
||||
size_t length = std::min(BUFLEN,
|
||||
static_cast<size_t>
|
||||
(_lastContentLength-_lastBody.tellg()));
|
||||
_socket->readData(buf, length);
|
||||
if(length == 0 && !(_socket->wantRead() || _socket->wantWrite())) {
|
||||
throw DlAbortEx(EX_EOF_FROM_PEER);
|
||||
|
|
|
@ -66,6 +66,8 @@ protected:
|
|||
public:
|
||||
XmlRpcMethod();
|
||||
|
||||
virtual ~XmlRpcMethod() {}
|
||||
|
||||
std::string execute(const XmlRpcRequest& req, DownloadEngine* e);
|
||||
};
|
||||
|
||||
|
|
|
@ -168,7 +168,9 @@ static void gatherProgressCommon
|
|||
(BDE& entryDict, const SharedHandle<RequestGroup>& group)
|
||||
{
|
||||
entryDict["gid"] = Util::itos(group->getGID());
|
||||
// This is "filtered" total length if --select-file is used.
|
||||
entryDict["totalLength"] = Util::uitos(group->getTotalLength());
|
||||
// This is "filtered" total length if --select-file is used.
|
||||
entryDict["completedLength"] = Util::uitos(group->getCompletedLength());
|
||||
TransferStat stat = group->calculateStat();
|
||||
entryDict["downloadSpeed"] = Util::uitos(stat.getDownloadSpeed());
|
||||
|
@ -280,12 +282,12 @@ BDE GetFilesXmlRpcMethod::process
|
|||
btctx->getFileEntries();
|
||||
|
||||
bool selectAll = fileIndexes.empty() || fileEntries.size() == 1;
|
||||
|
||||
size_t index = 1;
|
||||
|
||||
int32_t index = 1;
|
||||
for(std::deque<SharedHandle<FileEntry> >::const_iterator i =
|
||||
fileEntries.begin(); i != fileEntries.end(); ++i, ++index) {
|
||||
BDE entry = BDE::dict();
|
||||
entry["index"] = Util::uitos(index);
|
||||
entry["index"] = Util::itos(index);
|
||||
entry["path"] = (*i)->getPath();
|
||||
if(selectAll ||
|
||||
std::binary_search(fileIndexes.begin(), fileIndexes.end(), index)) {
|
||||
|
|
Loading…
Reference in New Issue