author | Michael Krelin <hacker@klever.net> | 2008-12-02 21:36:54 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2008-12-02 21:36:54 (UTC) |
commit | a2a524f744849e81ec91a7afbaf641d1b57e14b1 (patch) (side-by-side diff) | |
tree | d023154d9485179fdd3001d5816a0ebec05e5d5c | |
parent | 47bf5ab634dc5cc3bd5d71894b2d6681f7a83024 (diff) | |
download | libopkele-a2a524f744849e81ec91a7afbaf641d1b57e14b1.zip libopkele-a2a524f744849e81ec91a7afbaf641d1b57e14b1.tar.gz libopkele-a2a524f744849e81ec91a7afbaf641d1b57e14b1.tar.bz2 |
added passthrough unknown encoding handler to discovery parser
-rw-r--r-- | lib/discovery.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/discovery.cc b/lib/discovery.cc index bd1f917..cbdceb3 100644 --- a/lib/discovery.cc +++ b/lib/discovery.cc @@ -274,24 +274,25 @@ namespace opkele { throw exception_tidy(OPKELE_CP_ "tidy failed to save buffer"); prepare_to_parse(); parse(tide.c_str(),tide.size(),true); }catch(exception_tidy& et) { } } save_html.clear(); } void prepare_to_parse() { (*(expat_t*)this) = parser_create_ns(); set_user_data(); set_element_handler(); set_character_data_handler(); + set_unknown_encoding_handler(); if(xmode&xmode_html) { html_openid1.clear(); html_openid2.clear(); parser_choked = false; } cdata = 0; xrd_service = 0; skipping = 0; pt_stack.clear(); status_code = 100; status_string.clear(); } void html2xrd(endpoint_discovery_iterator& oi,idiscovery_t& id) { @@ -560,24 +561,31 @@ namespace opkele { }else{ for(xrd::local_ids_t::const_iterator ilid=svc.local_ids.begin(); ilid!=svc.local_ids.end(); ++ilid) { ep.local_id = ilid->second; *(oi++) = ep; } } } } } } + int unknown_encoding(const XML_Char *n,XML_Encoding *i) { + for(int ii=0;ii < sizeof(i->map)/sizeof(i->map[0]);++ii) + i->map[ii] = ii; + i->convert = 0; i->release = 0; + return XML_STATUS_OK; + } + }; string idiscover(endpoint_discovery_iterator oi,const string& identity) { idigger_t idigger; return idigger.discover(oi,identity); } void yadiscover(endpoint_discovery_iterator oi,const string& yurl,const char **types,bool redirs) try { idigger_t idigger; idigger.yadiscover(oi,yurl,types,redirs); }catch(exception_curl& ec) { if(redirs || ec._error!=CURLE_TOO_MANY_REDIRECTS) |