summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/srvrec.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-05-20 15:08:21 +0200
committerMichael Vogt <mvo@ubuntu.com>2014-05-20 15:08:21 +0200
commit8194f97685b4af2bbf0cdbdc88fe5332ad147353 (patch)
treebe399ccd85f91426ee72cc2407d75393c0464d4a /apt-pkg/contrib/srvrec.cc
parentf106fecc1d7d0250d1d76c2ba837dc0c870c5fff (diff)
add sorting by priority
Diffstat (limited to 'apt-pkg/contrib/srvrec.cc')
-rw-r--r--apt-pkg/contrib/srvrec.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/apt-pkg/contrib/srvrec.cc b/apt-pkg/contrib/srvrec.cc
index d5d89fc67..352a56970 100644
--- a/apt-pkg/contrib/srvrec.cc
+++ b/apt-pkg/contrib/srvrec.cc
@@ -12,6 +12,8 @@
#include <arpa/nameser.h>
#include <resolv.h>
+#include <algorithm>
+
#include <apt-pkg/error.h>
#include "srvrec.h"
@@ -89,5 +91,10 @@ bool GetSrvRecords(std::string name, std::vector<SrvRec> &Result)
Result.push_back(rec);
}
+ // sort them
+ std::stable_sort(Result.begin(), Result.end());
+
+ // FIXME: implement weight selection as specified in RFC-2782
+
return true;
}