rasmus Thu Jun 15 22:44:55 2006 UTC
Modified files:
/php-src/ext/soap php_encoding.c
Log:
Optimize the other string conversion functions here to just create raw
text nodes.
http://cvs.php.net/viewcvs.cgi/php-src/ext/soap/php_encoding.c?r1=1.128&r2=1.129&diff_format=u
Index: php-src/ext/soap/php_encoding.c
diff -u php-src/ext/soap/php_encoding.c:1.128
php-src/ext/soap/php_encoding.c:1.129
--- php-src/ext/soap/php_encoding.c:1.128 Thu Jun 15 18:03:30 2006
+++ php-src/ext/soap/php_encoding.c Thu Jun 15 22:44:55 2006
@@ -17,7 +17,7 @@
| Dmitry Stogov <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_encoding.c,v 1.128 2006/06/15 18:03:30 rasmus Exp $ */
+/* $Id: php_encoding.c,v 1.129 2006/06/15 22:44:55 rasmus Exp $ */
#include <time.h>
@@ -780,7 +780,7 @@
static xmlNodePtr to_xml_base64(encodeTypePtr type, zval *data, int style,
xmlNodePtr parent)
{
- xmlNodePtr ret;
+ xmlNodePtr ret, text;
unsigned char *str;
int str_len;
@@ -790,7 +790,8 @@
if (Z_TYPE_P(data) == IS_STRING) {
str = php_base64_encode((unsigned char*)Z_STRVAL_P(data),
Z_STRLEN_P(data), &str_len);
- xmlNodeSetContentLen(ret, str, str_len);
+ text = xmlNewTextLen(str, str_len);
+ xmlAddChild(ret, text);
efree(str);
} else {
zval tmp = *data;
@@ -798,7 +799,8 @@
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
str = php_base64_encode((unsigned char*)Z_STRVAL(tmp),
Z_STRLEN(tmp), &str_len);
- xmlNodeSetContentLen(ret, str, str_len);
+ text = xmlNewTextLen(str, str_len);
+ xmlAddChild(ret, text);
efree(str);
zval_dtor(&tmp);
}
@@ -812,7 +814,7 @@
static xmlNodePtr to_xml_hexbin(encodeTypePtr type, zval *data, int style,
xmlNodePtr parent)
{
static char hexconvtab[] = "0123456789ABCDEF";
- xmlNodePtr ret;
+ xmlNodePtr ret, text;
unsigned char *str;
zval tmp;
int i, j;
@@ -835,7 +837,8 @@
}
str[j] = '\0';
- xmlNodeSetContentLen(ret, str, Z_STRLEN_P(data) * 2 * sizeof(char));
+ text = xmlNewTextLen(str, Z_STRLEN_P(data) * 2 * sizeof(char));
+ xmlAddChild(ret, text);
efree(str);
if (data == &tmp) {
zval_dtor(&tmp);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php