-rw-r--r-- | include/opkele/types.h | 1 | ||||
-rw-r--r-- | lib/openid_message.cc | 9 |
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 @@ -130,4 +130,5 @@ namespace opkele { basic_openid_message(const basic_openid_message& x); void copy_to(basic_openid_message& x) const; + void append_to(basic_openid_message& x) const; virtual bool has_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 @@ -17,7 +17,5 @@ namespace opkele { __om_copier(basic_openid_message& t,const basic_openid_message& f) - : from(f), to(t) { - to.reset_fields(); - } + : from(f), to(t) { } result_type operator()(argument_type f) { @@ -29,4 +27,9 @@ namespace opkele { } void basic_openid_message::copy_to(basic_openid_message& x) const { + x.reset_fields(); + for_each(fields_begin(),fields_end(), + __om_copier(x,*this) ); + } + void basic_openid_message::append_to(basic_openid_message& x) const { for_each(fields_begin(),fields_end(), __om_copier(x,*this) ); |