summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--include/opkele/types.h1
-rw-r--r--lib/openid_message.cc9
2 files changed, 7 insertions, 3 deletions
diff --git a/include/opkele/types.h b/include/opkele/types.h
index af7fb1a..ffb9afb 100644
--- a/include/opkele/types.h
+++ b/include/opkele/types.h
@@ -129,6 +129,7 @@ namespace opkele {
129 virtual ~basic_openid_message() { } 129 virtual ~basic_openid_message() { }
130 basic_openid_message(const basic_openid_message& x); 130 basic_openid_message(const basic_openid_message& x);
131 void copy_to(basic_openid_message& x) const; 131 void copy_to(basic_openid_message& x) const;
132 void append_to(basic_openid_message& x) const;
132 133
133 virtual bool has_field(const string& n) const = 0; 134 virtual bool has_field(const string& n) const = 0;
134 virtual const string& get_field(const string& n) const = 0; 135 virtual const string& get_field(const string& n) const = 0;
diff --git a/lib/openid_message.cc b/lib/openid_message.cc
index 4b9179b..e244f43 100644
--- a/lib/openid_message.cc
+++ b/lib/openid_message.cc
@@ -16,9 +16,7 @@ namespace opkele {
16 basic_openid_message& to; 16 basic_openid_message& to;
17 17
18 __om_copier(basic_openid_message& t,const basic_openid_message& f) 18 __om_copier(basic_openid_message& t,const basic_openid_message& f)
19 : from(f), to(t) { 19 : from(f), to(t) { }
20 to.reset_fields();
21 }
22 20
23 result_type operator()(argument_type f) { 21 result_type operator()(argument_type f) {
24 to.set_field(f,from.get_field(f)); } 22 to.set_field(f,from.get_field(f)); }
@@ -28,6 +26,11 @@ namespace opkele {
28 x.copy_to(*this); 26 x.copy_to(*this);
29 } 27 }
30 void basic_openid_message::copy_to(basic_openid_message& x) const { 28 void basic_openid_message::copy_to(basic_openid_message& x) const {
29 x.reset_fields();
30 for_each(fields_begin(),fields_end(),
31 __om_copier(x,*this) );
32 }
33 void basic_openid_message::append_to(basic_openid_message& x) const {
31 for_each(fields_begin(),fields_end(), 34 for_each(fields_begin(),fields_end(),
32 __om_copier(x,*this) ); 35 __om_copier(x,*this) );
33 } 36 }