rasmus Thu Jun 15 22:45:30 2006 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/soap php_encoding.c
Log:
MFH: 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.103.2.21.2.2&r2=1.103.2.21.2.3&diff_format=u
Index: php-src/ext/soap/php_encoding.c
diff -u php-src/ext/soap/php_encoding.c:1.103.2.21.2.2
php-src/ext/soap/php_encoding.c:1.103.2.21.2.3
--- php-src/ext/soap/php_encoding.c:1.103.2.21.2.2 Thu Jun 15 20:49:05 2006
+++ php-src/ext/soap/php_encoding.c Thu Jun 15 22:45:30 2006
@@ -17,7 +17,7 @@
| Dmitry Stogov <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_encoding.c,v 1.103.2.21.2.2 2006/06/15 20:49:05 rasmus Exp $ */
+/* $Id: php_encoding.c,v 1.103.2.21.2.3 2006/06/15 22:45:30 rasmus Exp $ */
#include <time.h>
@@ -779,7 +779,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;
@@ -789,7 +789,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;
@@ -797,7 +798,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);
}
@@ -811,7 +813,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;
@@ -834,7 +836,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