[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/soap/php_sdl.c branches/PHP_5_4/NEWS branches/PHP_5_4/ext/soap/php_sdl.c trunk/ext/soap/php_sdl.c

2012-03-05 Thread Dmitry Stogov
dmitry   Mon, 05 Mar 2012 12:59:01 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323909

Log:
Fixed bug #60887 (SoapClient ignores user_agent option and sends no User-Agent 
header)

Bug: https://bugs.php.net/60887 (Assigned) SoapClient ignores user_agent option 
and sends no User-Agent header
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/ext/soap/php_sdl.c
U   php/php-src/trunk/ext/soap/php_sdl.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-03-05 12:47:25 UTC (rev 323908)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-03-05 12:59:01 UTC (rev 323909)
@@ -41,7 +41,11 @@

 - PHP-FPM SAPI:
   . Fixed bug #60811 (php-fpm compilation problem). (rasmus)
-
+
+- SOAP
+  . Fixed bug #60887 (SoapClient ignores user_agent option and sends no
+User-Agent header). (carloschilazo at gmail dot com)
+
 - SQLite3 extension:
   . Add createCollation() method. (Brad Dewar)


Modified: php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c
===
--- php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c 2012-03-05 12:47:25 UTC 
(rev 323908)
+++ php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c 2012-03-05 12:59:01 UTC 
(rev 323909)
@@ -3259,6 +3259,13 @@
context = php_stream_context_alloc();
}

+   if (zend_hash_find(Z_OBJPROP_P(this_ptr), _user_agent, 
sizeof(_user_agent), (void **) tmp) == SUCCESS 
+   Z_TYPE_PP(tmp) == IS_STRING  Z_STRLEN_PP(tmp)  0) {
+   smart_str_appends(headers, User-Agent: );
+   smart_str_appends(headers, Z_STRVAL_PP(tmp));
+   smart_str_appends(headers, \r\n);
+   }
+
if (zend_hash_find(Z_OBJPROP_P(this_ptr), _proxy_host, 
sizeof(_proxy_host), (void **) proxy_host) == SUCCESS 
Z_TYPE_PP(proxy_host) == IS_STRING 
zend_hash_find(Z_OBJPROP_P(this_ptr), _proxy_port, 
sizeof(_proxy_port), (void **) proxy_port) == SUCCESS 

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS   2012-03-05 12:47:25 UTC (rev 323908)
+++ php/php-src/branches/PHP_5_4/NEWS   2012-03-05 12:59:01 UTC (rev 323909)
@@ -38,6 +38,10 @@
 - mbstring:
   . MFH mb_ereg_replace_callback() for security enhancements. (Rui)

+- SOAP
+  . Fixed bug #60887 (SoapClient ignores user_agent option and sends no
+User-Agent header). (carloschilazo at gmail dot com)
+
 - Phar
   . Fixed bug #61184 (Phar::webPhar() generates headers with trailing NUL
 bytes). (Nikita Popov)

Modified: php/php-src/branches/PHP_5_4/ext/soap/php_sdl.c
===
--- php/php-src/branches/PHP_5_4/ext/soap/php_sdl.c 2012-03-05 12:47:25 UTC 
(rev 323908)
+++ php/php-src/branches/PHP_5_4/ext/soap/php_sdl.c 2012-03-05 12:59:01 UTC 
(rev 323909)
@@ -3259,6 +3259,13 @@
context = php_stream_context_alloc(TSRMLS_C);
}

+   if (zend_hash_find(Z_OBJPROP_P(this_ptr), _user_agent, 
sizeof(_user_agent), (void **) tmp) == SUCCESS 
+   Z_TYPE_PP(tmp) == IS_STRING  Z_STRLEN_PP(tmp)  0) {
+   smart_str_appends(headers, User-Agent: );
+   smart_str_appends(headers, Z_STRVAL_PP(tmp));
+   smart_str_appends(headers, \r\n);
+   }
+
if (zend_hash_find(Z_OBJPROP_P(this_ptr), _proxy_host, 
sizeof(_proxy_host), (void **) proxy_host) == SUCCESS 
Z_TYPE_PP(proxy_host) == IS_STRING 
zend_hash_find(Z_OBJPROP_P(this_ptr), _proxy_port, 
sizeof(_proxy_port), (void **) proxy_port) == SUCCESS 

Modified: php/php-src/trunk/ext/soap/php_sdl.c
===
--- php/php-src/trunk/ext/soap/php_sdl.c2012-03-05 12:47:25 UTC (rev 
323908)
+++ php/php-src/trunk/ext/soap/php_sdl.c2012-03-05 12:59:01 UTC (rev 
323909)
@@ -3259,6 +3259,13 @@
context = php_stream_context_alloc(TSRMLS_C);
}

+   if (zend_hash_find(Z_OBJPROP_P(this_ptr), _user_agent, 
sizeof(_user_agent), (void **) tmp) == SUCCESS 
+   Z_TYPE_PP(tmp) == IS_STRING  Z_STRLEN_PP(tmp)  0) {
+   smart_str_appends(headers, User-Agent: );
+   smart_str_appends(headers, Z_STRVAL_PP(tmp));
+   smart_str_appends(headers, \r\n);
+   }
+
if (zend_hash_find(Z_OBJPROP_P(this_ptr), _proxy_host, 
sizeof(_proxy_host), (void **) proxy_host) == SUCCESS 
Z_TYPE_PP(proxy_host) == IS_STRING 
zend_hash_find(Z_OBJPROP_P(this_ptr), _proxy_port, 
sizeof(_proxy_port), (void **) proxy_port) == SUCCESS 

-- 
PHP CVS Mailing List (http://www.php.net/)
To 

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/soap/php_sdl.c branches/PHP_5_4/NEWS branches/PHP_5_4/ext/soap/php_sdl.c trunk/ext/soap/php_sdl.c

2012-03-05 Thread Hannes Magnusson
On Mon, Mar 5, 2012 at 13:59, Dmitry Stogov dmi...@php.net wrote:
 dmitry                                   Mon, 05 Mar 2012 12:59:01 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=323909

 Log:
 Fixed bug #60887 (SoapClient ignores user_agent option and sends no 
 User-Agent header)

 Bug: https://bugs.php.net/60887 (Assigned) SoapClient ignores user_agent 
 option and sends no User-Agent header

 Changed paths:
    U   php/php-src/branches/PHP_5_3/NEWS
    U   php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c
    U   php/php-src/branches/PHP_5_4/NEWS
    U   php/php-src/branches/PHP_5_4/ext/soap/php_sdl.c
    U   php/php-src/trunk/ext/soap/php_sdl.c

 Modified: php/php-src/branches/PHP_5_3/NEWS
 ===
 --- php/php-src/branches/PHP_5_3/NEWS   2012-03-05 12:47:25 UTC (rev 323908)
 +++ php/php-src/branches/PHP_5_3/NEWS   2012-03-05 12:59:01 UTC (rev 323909)
 @@ -41,7 +41,11 @@

  - PHP-FPM SAPI:
   . Fixed bug #60811 (php-fpm compilation problem). (rasmus)
 -
 +
 +- SOAP
 +  . Fixed bug #60887 (SoapClient ignores user_agent option and sends no
 +    User-Agent header). (carloschilazo at gmail dot com)
 +
  - SQLite3 extension:
   . Add createCollation() method. (Brad Dewar)


 Modified: php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c
 ===
 --- php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c     2012-03-05 12:47:25 
 UTC (rev 323908)
 +++ php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c     2012-03-05 12:59:01 
 UTC (rev 323909)
 @@ -3259,6 +3259,13 @@
                context = php_stream_context_alloc();
        }

 +       if (zend_hash_find(Z_OBJPROP_P(this_ptr), _user_agent, 
 sizeof(_user_agent), (void **) tmp) == SUCCESS 
 +           Z_TYPE_PP(tmp) == IS_STRING  Z_STRLEN_PP(tmp)  0) {
 +               smart_str_appends(headers, User-Agent: );
 +               smart_str_appends(headers, Z_STRVAL_PP(tmp));
 +               smart_str_appends(headers, \r\n);
 +       }

Shouldn't it fallback on the ini option?

-Hannes

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/soap/php_sdl.c branches/PHP_5_4/NEWS branches/PHP_5_4/ext/soap/php_sdl.c trunk/ext/soap/php_sdl.c

2012-02-01 Thread Dmitry Stogov
dmitry   Wed, 01 Feb 2012 11:26:57 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=322992

Log:
Fixed basic HTTP authentication for WSDL sub requests

Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/ext/soap/php_sdl.c
U   php/php-src/trunk/ext/soap/php_sdl.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-02-01 11:07:56 UTC (rev 322991)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-02-01 11:26:57 UTC (rev 322992)
@@ -33,6 +33,9 @@
 - PDO_Sqlite extension:
   . Add createCollation support. (Damien)

+- SOAP:
+  . Fixed basic HTTP authentication for WSDL sub requests. (Dmitry)
+
 10 Jan 2012, PHP 5.3.9

 - Core:

Modified: php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c
===
--- php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c 2012-02-01 11:07:56 UTC 
(rev 322991)
+++ php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c 2012-02-01 11:26:57 UTC 
(rev 322992)
@@ -242,6 +242,40 @@
if (!s) return;
s = strchr(s+3, '/');
l2 = s - (char*)uri;
+   if (l1 != l2) {
+   /* check for http://...:80/ */
+   if (l1  11 
+   ctx-sdl-source[4] == ':' 
+   ctx-sdl-source[l1-3] == ':' 
+   ctx-sdl-source[l1-2] == '8' 
+   ctx-sdl-source[l1-1] == '0') {
+   l1 -= 3;
+   }
+   if (l2  11 
+   uri[4] == ':' 
+   uri[l2-3] == ':' 
+   uri[l2-2] == '8' 
+   uri[l2-1] == '0') {
+   l2 -= 3;
+   }
+   /* check for https://...:443/ */
+   if (l1  13 
+   ctx-sdl-source[4] == 's' 
+   ctx-sdl-source[l1-4] == ':' 
+   ctx-sdl-source[l1-3] == '4' 
+   ctx-sdl-source[l1-2] == '4' 
+   ctx-sdl-source[l1-1] == '3') {
+   l1 -= 4;
+   }
+   if (l2  13 
+   uri[4] == 's' 
+   uri[l2-4] == ':' 
+   uri[l2-3] == '4' 
+   uri[l2-2] == '4' 
+   uri[l2-1] == '3') {
+   l2 -= 4;
+   }
+   }
if (l1 != l2 || memcmp(ctx-sdl-source, uri, l1) != 0) {
/* another server. clear authentication credentals */
context = php_libxml_switch_context(NULL TSRMLS_CC);

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS   2012-02-01 11:07:56 UTC (rev 322991)
+++ php/php-src/branches/PHP_5_4/NEWS   2012-02-01 11:26:57 UTC (rev 322992)
@@ -16,6 +16,9 @@
   . Fixed bug #60860 (session.save_handler=user without defined function core
 dumps). (Felipe)

+- SOAP:
+  . Fixed basic HTTP authentication for WSDL sub requests. (Dmitry)
+
 19 Jan 2012, PHP 5.4.0 RC6

 - Core:

Modified: php/php-src/branches/PHP_5_4/ext/soap/php_sdl.c
===
--- php/php-src/branches/PHP_5_4/ext/soap/php_sdl.c 2012-02-01 11:07:56 UTC 
(rev 322991)
+++ php/php-src/branches/PHP_5_4/ext/soap/php_sdl.c 2012-02-01 11:26:57 UTC 
(rev 322992)
@@ -242,6 +242,40 @@
if (!s) return;
s = strchr(s+3, '/');
l2 = s - (char*)uri;
+   if (l1 != l2) {
+   /* check for http://...:80/ */
+   if (l1  11 
+   ctx-sdl-source[4] == ':' 
+   ctx-sdl-source[l1-3] == ':' 
+   ctx-sdl-source[l1-2] == '8' 
+   ctx-sdl-source[l1-1] == '0') {
+   l1 -= 3;
+   }
+   if (l2  11 
+   uri[4] == ':' 
+   uri[l2-3] == ':' 
+   uri[l2-2] == '8' 
+   uri[l2-1] == '0') {
+   l2 -= 3;
+   }
+   /* check for https://...:443/ */
+   if (l1  13 
+   ctx-sdl-source[4] == 's' 
+   ctx-sdl-source[l1-4] == ':' 
+   ctx-sdl-source[l1-3] == '4' 
+   ctx-sdl-source[l1-2] == '4' 
+   ctx-sdl-source[l1-1] == '3') {
+   l1 -= 4;
+   }
+   if (l2  13 
+   uri[4] == 's' 
+   uri[l2-4] == ':' 
+   uri[l2-3] == '4' 
+   uri[l2-2] == '4' 
+   uri[l2-1] == '3') {
+   l2 -= 4;
+   }
+   }
if (l1 != l2 || memcmp(ctx-sdl-source, uri, l1) != 0) {