[pan2/testing: 250/279] forgot some adaptions
- From: Heinrich MÃller <henmull src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pan2/testing: 250/279] forgot some adaptions
- Date: Sat, 3 Dec 2011 22:42:25 +0000 (UTC)
commit 32e5512e27490b29307021c1667091aa12da4ca7
Author: Heinrich MÃller <sphemuel stud informatik uni-erlangen de>
Date: Wed Nov 23 11:44:16 2011 +0100
forgot some adaptions
pan/data-impl/server.cc | 2 +-
pan/data/cert-store.cc | 4 ++--
pan/data/cert-store.h | 11 +++++++++--
pan/gui/server-ui.cc | 8 ++++----
4 files changed, 16 insertions(+), 9 deletions(-)
---
diff --git a/pan/data-impl/server.cc b/pan/data-impl/server.cc
index be95549..c416896 100644
--- a/pan/data-impl/server.cc
+++ b/pan/data-impl/server.cc
@@ -383,7 +383,7 @@ DataImpl :: load_server_properties (const DataIO& source)
s.rank = to_int(kv["rank"], 1);
int ssl(to_int(kv["use-ssl"], 0));
s.ssl_support = ssl;
- if (ssl == 1) s.cert = kv["cert"];
+ s.cert = kv["cert"];
s.newsrc_filename = kv["newsrc"];
if (s.newsrc_filename.empty()) { // set a default filename
std::ostringstream o;
diff --git a/pan/data/cert-store.cc b/pan/data/cert-store.cc
index 672b4ac..56b5920 100644
--- a/pan/data/cert-store.cc
+++ b/pan/data/cert-store.cc
@@ -97,8 +97,8 @@ namespace pan
PEM_read_X509(fp,&x, 0, 0);
fclose(fp);
setme.insert(x);
- _certs.insert(s->host);
- _cert_to_server[s->host] = x;
+ _certs.insert(*it);
+ _cert_to_server[*it] = x;
++cnt;
}
diff --git a/pan/data/cert-store.h b/pan/data/cert-store.h
index 7fe1a80..eb0487f 100644
--- a/pan/data/cert-store.h
+++ b/pan/data/cert-store.h
@@ -105,6 +105,14 @@ namespace pan
std::cerr<<"#################\n\n";
}
+ void dump_certs()
+ {
+ std::cerr<<"#################\n";
+ foreach_const(certs_t, _certs, it)
+ std::cerr<<*it<<"\n";
+ std::cerr<<"#################\n\n";
+ }
+
private:
void remove_hard(const Quark&);
@@ -112,7 +120,7 @@ namespace pan
bool add(X509*, const Quark&) ;
void remove (const Quark&);
- bool exist (const Quark& q) { return (_certs.count(q) > 0); }
+ bool exist (const Quark& q) { /*dump_certs(); std::cerr<<"q "<<q<<"\n\n"; */ return (_certs.count(q) > 0); }
static std::string build_cert_name(std::string host);
@@ -133,7 +141,6 @@ namespace pan
/* notify functions for listener list */
void verify_failed (X509* c, std::string server, std::string cn, int nr)
{
- std::cerr<<"verify failed "<<server<<" "<<cn<<"\n";
for (listeners_t::iterator it(_listeners.begin()), end(_listeners.end()); it!=end; ++it)
(*it)->on_verify_cert_failed (c, server, cn, nr);
}
diff --git a/pan/gui/server-ui.cc b/pan/gui/server-ui.cc
index a4e5d8e..b5854c9 100644
--- a/pan/gui/server-ui.cc
+++ b/pan/gui/server-ui.cc
@@ -334,7 +334,7 @@ pan :: server_edit_dialog_new (Data& data, Queue& queue, GtkWindow * window, con
// max connections
const int DEFAULT_MAX_PER_SERVER (4);
- a = GTK_ADJUSTMENT (gtk_adjustment_new (1.0, 0.0, DEFAULT_MAX_PER_SERVER, 1.0, 1.0, 0.0));
+ a = GTK_ADJUSTMENT (gtk_adjustment_new (1.0, 1.0, DEFAULT_MAX_PER_SERVER, 1.0, 1.0, 0.0));
d->connection_limit_spin = w = gtk_spin_button_new (GTK_ADJUSTMENT(a), 1.0, 0u);
HIG::workarea_add_row (t, &row, _("Connection _Limit:"), w, NULL);
@@ -674,7 +674,7 @@ namespace
char buf[4096] ;
if (!selected_server.empty()) {
- X509* cert (store.get_cert_to_server(addr));
+ X509* cert (store.get_cert_to_server(selected_server));
if (cert)
{
pretty_print_x509(buf,sizeof(buf),addr, cert,false);
@@ -684,7 +684,7 @@ namespace
GTK_DIALOG_MODAL,
GTK_MESSAGE_INFO,
GTK_BUTTONS_CLOSE, buf);
- g_snprintf(buf,sizeof(buf), _("Server Certificate for <b>'%s'</b>"), addr.c_str());
+ g_snprintf(buf,sizeof(buf), _("Server Certificate for '%s'"), addr.c_str());
gtk_window_set_title(GTK_WINDOW(w), buf);
gtk_widget_show_all (w);
g_signal_connect_swapped (w, "response", G_CALLBACK (gtk_widget_destroy), w);
@@ -714,7 +714,7 @@ namespace
GtkTreeIter iter;
gtk_list_store_append (d->servers_store, &iter);
gtk_list_store_set (d->servers_store, &iter,
- COL_FLAG, store.exist(addr),
+ COL_FLAG, store.exist(server),
COL_HOST, addr.c_str(),
COL_DATA, server.c_str(),
-1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]