author | Michael Krelin <hacker@klever.net> | 2008-02-22 12:33:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2008-02-22 12:33:42 (UTC) |
commit | 4c9564dce14fdc46ef6739426ee1cad87ed58ad1 (patch) (side-by-side diff) | |
tree | 6f1f520d56b5e346abb6bf9514b697c7e2240819 | |
parent | daf2d4bcb4a31df6b46d3da7a33ee3f98d85e464 (diff) | |
download | libopkele-4c9564dce14fdc46ef6739426ee1cad87ed58ad1.zip libopkele-4c9564dce14fdc46ef6739426ee1cad87ed58ad1.tar.gz libopkele-4c9564dce14fdc46ef6739426ee1cad87ed58ad1.tar.bz2 |
fix the discovery for the case when identity URL points to XRDS document.
Signed-off-by: Michael Krelin <hacker@klever.net>
-rw-r--r-- | lib/discovery.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/discovery.cc b/lib/discovery.cc index 5913ad4..c118c80 100644 --- a/lib/discovery.cc +++ b/lib/discovery.cc @@ -195,17 +195,23 @@ namespace opkele { rv = idis.normalized_id = util::rfc_3986_normalize_uri(id); discover_at(idis,id,xmode_html|xmode_xrd); const char * eu = 0; CURLcode r = easy_getinfo(CURLINFO_EFFECTIVE_URL,&eu); if(r) throw exception_curl(OPKELE_CP_ "failed to get CURLINFO_EFFECTIVE_URL",r); string cid = util::strip_uri_fragment_part( idis.canonicalized_id = util::rfc_3986_normalize_uri(eu) ); if(xrds_location.empty()) { - html2xrd(oi,idis); + if(idis.xrd.empty()) + html2xrd(oi,idis); + else{ + for(const service_type_t *st=op_service_types; + st<&op_service_types[sizeof(op_service_types)/sizeof(*op_service_types)];++st) + queue_endpoints(oi,idis,st); + } }else{ idis.clear(); idis.canonicalized_id = cid; discover_at(idis,xrds_location,xmode_xrd); if(idis.xrd.empty()) html2xrd(oi,idis); else{ for(const service_type_t *st=op_service_types; |