Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
build
*.info
*.pyc
*.rpm
Expand Down
12 changes: 9 additions & 3 deletions src/db/generic/Pair.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,29 @@
#include "common/Uri.h"

struct Pair {
std::string source, destination;
std::string source, destination, vo;

Pair(const std::string &s, const std::string &d): source(s), destination(d) {
Pair(const std::string &s, const std::string &d): source(s), destination(d), vo("") {
}

Pair(const std::string &s, const std::string &d, const std::string &v): source(s), destination(d), vo(v) {
}

bool isLanTransfer() const {
return fts3::common::isLanTransfer(source, destination);
}
};

// FIXME: So far, assume each (source, destination) pair only has one vo first.
// Support multiple vo later.

// Required so it can be used as a key on a std::map
inline bool operator < (const Pair &a, const Pair &b) {
return a.source < b.source || (a.source == b.source && a.destination < b.destination);
}

inline bool operator == (const Pair &a, const Pair &b) {
return a.source == b.source && a.destination == b.destination;
return a.source == b.source && a.destination == b.destination;
}

inline std::ostream& operator << (std::ostream &os, const Pair &pair) {
Expand Down
7 changes: 3 additions & 4 deletions src/db/generic/ThrInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@
#include "common/Uri.h"

struct TransferredStat {
int64_t transferred, limit;
int64_t transferred;
double limit;

TransferredStat(const int64_t &t, const int64_t &l):
transferred(t), limit(l)
{
TransferredStat(const int64_t &t, const double &l): transferred(t), limit(l) {
}
};

Expand Down
Loading