[pan2/xzver_support: 47/47] sfdsd
- From: Heinrich MÃller <henmull src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pan2/xzver_support: 47/47] sfdsd
- Date: Sun, 10 Jun 2012 19:20:27 +0000 (UTC)
commit f718bf69139faa9453620fa3acf1432a1202405e
Author: Heinrich MÃller <henmull src gnome org>
Date: Sun Jun 10 21:18:39 2012 +0200
sfdsd
pan/data-impl/data-impl.h | 5 +++++
pan/data-impl/groups.cc | 2 +-
pan/data-impl/server.cc | 23 +++++++++++++++++++++++
3 files changed, 29 insertions(+), 1 deletions(-)
---
diff --git a/pan/data-impl/data-impl.h b/pan/data-impl/data-impl.h
index 5859bd6..1980fd2 100644
--- a/pan/data-impl/data-impl.h
+++ b/pan/data-impl/data-impl.h
@@ -140,6 +140,9 @@ namespace pan
virtual void set_server_trust (const Quark & servername,
int setme);
+ virtual void set_server_compression_type (const Quark & servername,
+ int setme);
+
virtual void set_server_addr (const Quark & server,
const StringView & host,
const int port);
@@ -174,6 +177,8 @@ namespace pan
virtual bool get_server_trust (const Quark & servername, int&) const;
+ virtual bool get_server_compression_type (const Quark & servername, CompressionType&) const;
+
virtual bool get_server_addr (const Quark & server,
std::string & setme_host,
int & setme_port) const;
diff --git a/pan/data-impl/groups.cc b/pan/data-impl/groups.cc
index b9ef49c..ccf2bca 100644
--- a/pan/data-impl/groups.cc
+++ b/pan/data-impl/groups.cc
@@ -491,7 +491,7 @@ DataImpl :: set_xover_high (const Quark & group,
const Quark & server,
const uint64_t high)
{
- //std::cerr << LINE_ID << "setting " << get_server_address(server) << ':' << group << " xover high to " << high << std::endl;
+ std::cerr << LINE_ID << "setting " << get_server_address(server) << ':' << group << " xover high to " << high << std::endl;
ReadGroup::Server& rgs (_read_groups[group][server]);
rgs._xover_high = high;
}
diff --git a/pan/data-impl/server.cc b/pan/data-impl/server.cc
index 40f27c0..6553b1b 100644
--- a/pan/data-impl/server.cc
+++ b/pan/data-impl/server.cc
@@ -157,6 +157,15 @@ DataImpl :: set_server_trust (const Quark & server,
}
void
+DataImpl :: set_server_compression_type (const Quark & server,
+ const int setme)
+{
+ Server * s (find_server (server));
+ assert (s);
+ s->compression_type = setme;
+}
+
+void
DataImpl :: set_server_addr (const Quark & server,
const StringView & host,
int port)
@@ -286,6 +295,18 @@ DataImpl :: get_server_trust (const Quark & server, int& setme) const
}
bool
+DataImpl :: get_server_compression_type (const Quark & server, CompressionType& setme) const
+{
+ const Server * s (find_server (server));
+ const bool found (s);
+ if (found) {
+ setme = get_compression_type(s->compression_type);
+ }
+
+ return found;
+}
+
+bool
DataImpl :: get_server_addr (const Quark & server,
std::string & setme_host,
int & setme_port) const
@@ -481,6 +502,7 @@ DataImpl :: load_server_properties (const DataIO& source)
s.cert = kv["cert"];
int trust(to_int(kv["trust"], 0));
s.trust = trust;
+ s.compression_type = to_int(kv["compression-type"], 0); // NONE
s.newsrc_filename = kv["newsrc"];
if (s.newsrc_filename.empty()) { // set a default filename
std::ostringstream o;
@@ -545,6 +567,7 @@ else
<< indent(depth) << "<rank>" << s->rank << "</rank>\n"
<< indent(depth) << "<use-ssl>" << s->ssl_support << "</use-ssl>\n"
<< indent(depth) << "<trust>" << s->trust << "</trust>\n"
+ << indent(depth) << "<compression-type>" << s->compression_type << "</compression-type>\n"
<< indent(depth) << "<cert>" << s->cert << "</cert>\n";
*out << indent(--depth) << "</server>\n";
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]