-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 { | |||
195 | rv = idis.normalized_id = util::rfc_3986_normalize_uri(id); | 195 | rv = idis.normalized_id = util::rfc_3986_normalize_uri(id); |
196 | discover_at(idis,id,xmode_html|xmode_xrd); | 196 | discover_at(idis,id,xmode_html|xmode_xrd); |
197 | const char * eu = 0; | 197 | const char * eu = 0; |
198 | CURLcode r = easy_getinfo(CURLINFO_EFFECTIVE_URL,&eu); | 198 | CURLcode r = easy_getinfo(CURLINFO_EFFECTIVE_URL,&eu); |
199 | if(r) | 199 | if(r) |
200 | throw exception_curl(OPKELE_CP_ "failed to get CURLINFO_EFFECTIVE_URL",r); | 200 | throw exception_curl(OPKELE_CP_ "failed to get CURLINFO_EFFECTIVE_URL",r); |
201 | string cid = util::strip_uri_fragment_part( idis.canonicalized_id = util::rfc_3986_normalize_uri(eu) ); | 201 | string cid = util::strip_uri_fragment_part( idis.canonicalized_id = util::rfc_3986_normalize_uri(eu) ); |
202 | if(xrds_location.empty()) { | 202 | if(xrds_location.empty()) { |
203 | html2xrd(oi,idis); | 203 | if(idis.xrd.empty()) |
204 | html2xrd(oi,idis); | ||
205 | else{ | ||
206 | for(const service_type_t *st=op_service_types; | ||
207 | st<&op_service_types[sizeof(op_service_types)/sizeof(*op_service_types)];++st) | ||
208 | queue_endpoints(oi,idis,st); | ||
209 | } | ||
204 | }else{ | 210 | }else{ |
205 | idis.clear(); | 211 | idis.clear(); |
206 | idis.canonicalized_id = cid; | 212 | idis.canonicalized_id = cid; |
207 | discover_at(idis,xrds_location,xmode_xrd); | 213 | discover_at(idis,xrds_location,xmode_xrd); |
208 | if(idis.xrd.empty()) | 214 | if(idis.xrd.empty()) |
209 | html2xrd(oi,idis); | 215 | html2xrd(oi,idis); |
210 | else{ | 216 | else{ |
211 | for(const service_type_t *st=op_service_types; | 217 | for(const service_type_t *st=op_service_types; |