author | Michael Krelin <hacker@klever.net> | 2007-12-30 21:08:55 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2008-01-04 18:22:43 (UTC) |
commit | b7cec6ccef5d4178cf02c4cc240fd39ab7c8fe97 (patch) (side-by-side diff) | |
tree | c898f449b4238a239f491a62bd77ac7c75663bb1 | |
parent | 4b75ac58aa9baaf611df8ef694fd585529823c66 (diff) | |
download | libopkele-b7cec6ccef5d4178cf02c4cc240fd39ab7c8fe97.zip libopkele-b7cec6ccef5d4178cf02c4cc240fd39ab7c8fe97.tar.gz libopkele-b7cec6ccef5d4178cf02c4cc240fd39ab7c8fe97.tar.bz2 |
parse ProviderID while doing discovery
Signed-off-by: Michael Krelin <hacker@klever.net>
-rw-r--r-- | include/opkele/types.h | 4 | ||||
-rw-r--r-- | lib/discovery.cc | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/include/opkele/types.h b/include/opkele/types.h index d959021..4e1415f 100644 --- a/include/opkele/types.h +++ b/include/opkele/types.h @@ -202,32 +202,36 @@ namespace opkele { class service_t { public: types_t types; uris_t uris; local_ids_t local_ids; + string provider_id; void clear() { types.clear(); uris.clear(); local_ids.clear(); + provider_id.clear(); } }; typedef priority_map<service_t> services_t; class XRD_t { public: time_t expires; canonical_ids_t canonical_ids; local_ids_t local_ids; services_t services; + string provider_id; void clear() { expires = 0; canonical_ids.clear(); local_ids.clear(); services.clear(); + provider_id.clear(); } bool empty() const { return canonical_ids.empty() && local_ids.empty() && services.empty(); diff --git a/lib/discovery.cc b/lib/discovery.cc index bc7d6fb..81727c0 100644 --- a/lib/discovery.cc +++ b/lib/discovery.cc @@ -233,12 +233,15 @@ namespace opkele { if(is_qelement(n,NSURI_XRD "\tCanonicalID")) { assert(xrd); cdata = &(xrd->canonical_ids.add(element_priority(a),string())); }else if(is_qelement(n,NSURI_XRD "\tLocalID")) { assert(xrd); cdata = &(xrd->local_ids.add(element_priority(a),string())); + }else if(is_qelement(n,NSURI_XRD "\tProviderID")) { + assert(xrd); + cdata = &(xrd->provider_id); }else if(is_qelement(n,NSURI_XRD "\tService")) { assert(xrd); xrd_service = &(xrd->services.add(element_priority(a), service_t())); pt_stack.push_back(n); }else if(is_qelement(n,NSURI_XRD "\tStatus")) { @@ -270,12 +273,15 @@ namespace opkele { assert(xrd); assert(xrd_service); cdata = &(xrd_service->uris.add(element_priority(a),string())); }else if(is_qelement(n,NSURI_XRD "\tLocalID") || is_qelement(n,NSURI_OPENID10 "\tDelegate") ) { assert(xrd); assert(xrd_service); cdata = &(xrd_service->local_ids.add(element_priority(a),string())); + }else if(is_qelement(n,NSURI_XRD "\tProviderID")) { + assert(xrd); assert(xrd_service); + cdata = &(xrd_service->provider_id); }else{ skipping = 1; } }else skipping = 1; }else if(xmode&xmode_html) { |