summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--COPYING2
-rw-r--r--NEWS.xml8
-rw-r--r--configure.ac2
-rw-r--r--include/opkele/expat.h3
-rw-r--r--lib/basic_rp.cc1
-rw-r--r--lib/discovery.cc53
-rw-r--r--lib/expat.cc9
7 files changed, 61 insertions, 17 deletions
diff --git a/COPYING b/COPYING
index 06cc949..46d3f30 100644
--- a/COPYING
+++ b/COPYING
@@ -1,4 +1,4 @@
1Copyright (c) 2005-2007 Klever Group (http://www.klever.net/) 1Copyright (c) 2005-2008 Klever Group (http://www.klever.net/)
2 2
3Permission is hereby granted, free of charge, to any person obtaining a copy of 3Permission is hereby granted, free of charge, to any person obtaining a copy of
4this software and associated documentation files (the "Software"), to deal in 4this software and associated documentation files (the "Software"), to deal in
diff --git a/NEWS.xml b/NEWS.xml
index b20576f..160b197 100644
--- a/NEWS.xml
+++ b/NEWS.xml
@@ -1,5 +1,13 @@
1<?xml version="1.0" encoding="us-ascii"?> 1<?xml version="1.0" encoding="us-ascii"?>
2<news> 2<news>
3 <version version="2.0.1" date="November 22nd, 2008">
4 <ni>Compile-time fixes and improvements</ni>
5 <ni>Portability improvements for FreeBSD</ni>
6 <ni>Really suppress debugging message from htmltidy when --disable-debug is in
7 effect</ni>
8 <ni>minor bugfixes</ni>
9 <ni>thread-safety improvements</ni>
10 </version>
3 <version version="2.0" date="June 26th, 2008"> 11 <version version="2.0" date="June 26th, 2008">
4 <ni>OpenID 2.0 support</ni> 12 <ni>OpenID 2.0 support</ni>
5 <ni>Major rewrite of the whole thing</ni> 13 <ni>Major rewrite of the whole thing</ni>
diff --git a/configure.ac b/configure.ac
index 3484146..a7b56ff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
1AC_INIT([libopkele], [2.0], [libopkele-bugs@klever.net]) 1AC_INIT([libopkele], [2.0.1], [libopkele-bugs@klever.net])
2AC_CONFIG_SRCDIR([include/opkele/opkele-config.h]) 2AC_CONFIG_SRCDIR([include/opkele/opkele-config.h])
3AC_CONFIG_HEADERS([config.h include/opkele/acconfig.h]) 3AC_CONFIG_HEADERS([config.h include/opkele/acconfig.h])
4AM_INIT_AUTOMAKE([dist-bzip2]) 4AM_INIT_AUTOMAKE([dist-bzip2])
diff --git a/include/opkele/expat.h b/include/opkele/expat.h
index 3ab1630..21be003 100644
--- a/include/opkele/expat.h
+++ b/include/opkele/expat.h
@@ -26,6 +26,9 @@ namespace opkele {
26 return XML_Parse(_x,s,len,final); 26 return XML_Parse(_x,s,len,final);
27 } 27 }
28 28
29 virtual int unknown_encoding(const XML_Char * /* n */,XML_Encoding * /* i */) { return XML_STATUS_ERROR; }
30 void set_unknown_encoding_handler();
31
29 virtual void start_element(const XML_Char * /* n */,const XML_Char ** /* a */) { } 32 virtual void start_element(const XML_Char * /* n */,const XML_Char ** /* a */) { }
30 virtual void end_element(const XML_Char * /* n */) { } 33 virtual void end_element(const XML_Char * /* n */) { }
31 void set_element_handler(); 34 void set_element_handler();
diff --git a/lib/basic_rp.cc b/lib/basic_rp.cc
index 3357d0b..3cad71c 100644
--- a/lib/basic_rp.cc
+++ b/lib/basic_rp.cc
@@ -1,3 +1,4 @@
1#include <sys/types.h>
1#include <cassert> 2#include <cassert>
2#include <openssl/sha.h> 3#include <openssl/sha.h>
3#include <openssl/hmac.h> 4#include <openssl/hmac.h>
diff --git a/lib/discovery.cc b/lib/discovery.cc
index bd1f917..26f3eed 100644
--- a/lib/discovery.cc
+++ b/lib/discovery.cc
@@ -283,6 +283,7 @@ namespace opkele {
283 (*(expat_t*)this) = parser_create_ns(); 283 (*(expat_t*)this) = parser_create_ns();
284 set_user_data(); set_element_handler(); 284 set_user_data(); set_element_handler();
285 set_character_data_handler(); 285 set_character_data_handler();
286 set_unknown_encoding_handler();
286 287
287 if(xmode&xmode_html) { 288 if(xmode&xmode_html) {
288 html_openid1.clear(); html_openid2.clear(); 289 html_openid1.clear(); html_openid2.clear();
@@ -453,25 +454,40 @@ namespace opkele {
453 --skipping; return; 454 --skipping; return;
454 } 455 }
455 if(is_qelement(n,NSURI_XRD "\tType")) { 456 if(is_qelement(n,NSURI_XRD "\tType")) {
456 assert(xrd); assert(xrd_service); assert(cdata==&cdata_buf); 457 if(xrd && xrd_service) {
457 xrd_service->types.insert(cdata_buf); 458 assert(cdata==&cdata_buf);
459 xrd_service->types.insert(cdata_buf);
460 }
458 }else if(is_qelement(n,NSURI_XRD "\tService")) { 461 }else if(is_qelement(n,NSURI_XRD "\tService")) {
459 assert(xrd); assert(xrd_service); 462 if(!(xrd && xrd_service)) {
460 assert(!pt_stack.empty()); 463 skipping = -1;
461 assert(pt_stack.back()==(NSURI_XRD "\tService")); 464 }else{
462 pt_stack.pop_back(); 465 assert(!pt_stack.empty());
463 xrd_service = 0; 466 assert(pt_stack.back()==(NSURI_XRD "\tService"));
464 }else if(is_qelement(n,NSURI_XRD "\tStatus")) {
465 assert(xrd);
466 if(is_qelement(pt_stack.back().c_str(),n)) {
467 assert(cdata==&status_string);
468 pt_stack.pop_back(); 467 pt_stack.pop_back();
469 if(status_code!=100) 468 xrd_service = 0;
470 skipping = -1; 469 }
470 }else if(is_qelement(n,NSURI_XRD "\tStatus")) {
471 if(!xrd) {
472 skipping=-1;
473 }else{
474 if(is_qelement(pt_stack.back().c_str(),n)) {
475 assert(cdata==&status_string);
476 pt_stack.pop_back();
477 if(status_code!=100)
478 skipping = -1;
479 }
471 } 480 }
472 }else if(is_qelement(n,NSURI_XRD "\tExpires")) { 481 }else if(is_qelement(n,NSURI_XRD "\tExpires")) {
473 assert(xrd); 482 if(!xrd) {
474 xrd->expires = util::w3c_to_time(cdata_buf); 483 skipping=-1;
484 }else{
485 xrd->expires = util::w3c_to_time(cdata_buf);
486 }
487 }else if(is_qelement(n,NSURI_XRD "\tXRD")) {
488 assert(!pt_stack.empty());
489 assert(pt_stack.back()==(NSURI_XRD "\tXRD"));
490 pt_stack.pop_back();
475 }else if((xmode&xmode_html) && is_element(n,"head")) { 491 }else if((xmode&xmode_html) && is_element(n,"head")) {
476 skipping = -1; 492 skipping = -1;
477 } 493 }
@@ -569,6 +585,13 @@ namespace opkele {
569 } 585 }
570 } 586 }
571 587
588 int unknown_encoding(const XML_Char *n,XML_Encoding *i) {
589 for(int ii=0;ii < sizeof(i->map)/sizeof(i->map[0]);++ii)
590 i->map[ii] = ii;
591 i->convert = 0; i->release = 0;
592 return XML_STATUS_OK;
593 }
594
572 }; 595 };
573 596
574 string idiscover(endpoint_discovery_iterator oi,const string& identity) { 597 string idiscover(endpoint_discovery_iterator oi,const string& identity) {
diff --git a/lib/expat.cc b/lib/expat.cc
index c4dab7e..fb58a9a 100644
--- a/lib/expat.cc
+++ b/lib/expat.cc
@@ -92,6 +92,15 @@ namespace opkele {
92 XML_SetNamespaceDeclHandler(_x,_start_namespace_decl,_end_namespace_decl); 92 XML_SetNamespaceDeclHandler(_x,_start_namespace_decl,_end_namespace_decl);
93 } 93 }
94 94
95 static int _unknown_encoding(void *ehd,const XML_Char *n,XML_Encoding *i) {
96 return ((expat_t*)ehd)->unknown_encoding(n,i);
97 }
98
99 void expat_t::set_unknown_encoding_handler() {
100 assert(_x);
101 XML_SetUnknownEncodingHandler(_x,_unknown_encoding,this);
102 }
103
95 } 104 }
96 105
97} 106}