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

2010-10-05 Thread Dmitry Stogov
dmitry   Tue, 05 Oct 2010 11:43:59 +

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

Log:
Fixed bug #44248 (RFC2616 transgression while HTTPS request through proxy with 
SoapClient object).

Bug: http://bugs.php.net/44248 (Assigned) RFC2616 transgression while HTTPS 
request through proxy with SoapClient object
  
Changed paths:
U   php/php-src/branches/PHP_5_2/NEWS
U   php/php-src/branches/PHP_5_2/ext/soap/php_http.c
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/soap/php_http.c
U   php/php-src/trunk/ext/soap/php_http.c

Modified: php/php-src/branches/PHP_5_2/NEWS
===
--- php/php-src/branches/PHP_5_2/NEWS   2010-10-05 11:28:56 UTC (rev 304083)
+++ php/php-src/branches/PHP_5_2/NEWS   2010-10-05 11:43:59 UTC (rev 304084)
@@ -16,6 +16,8 @@
   (Sriram Natarajan)
 - Fixed bug #52390 (mysqli_report() should be per-request setting). (Kalle)
 - Fixed bug #51008 (Zend/tests/bug45877.phpt fails). (Dmitry)
+- Fixed bug #44248 (RFC2616 transgression while HTTPS request through proxy
+  with SoapClient object). (Dmitry)

 22 Jul 2010, PHP 5.2.14
 - Reverted bug fix #49521 (PDO fetchObject sets values before calling

Modified: php/php-src/branches/PHP_5_2/ext/soap/php_http.c
===
--- php/php-src/branches/PHP_5_2/ext/soap/php_http.c2010-10-05 11:28:56 UTC 
(rev 304083)
+++ php/php-src/branches/PHP_5_2/ext/soap/php_http.c2010-10-05 11:43:59 UTC 
(rev 304084)
@@ -167,6 +167,13 @@
smart_str_appendc(soap_headers, ':');
smart_str_append_unsigned(soap_headers, phpurl-port);
smart_str_append_const(soap_headers,  HTTP/1.1\r\n);
+   smart_str_append_const(soap_headers, Host: );
+   smart_str_appends(soap_headers, phpurl-host);
+   if (phpurl-port != 80) {
+   smart_str_appendc(soap_headers, ':');
+   smart_str_append_unsigned(soap_headers, phpurl-port);
+   }
+   smart_str_append_const(soap_headers, \r\n);
proxy_authentication(this_ptr, soap_headers TSRMLS_CC);
smart_str_append_const(soap_headers, \r\n);
if (php_stream_write(stream, soap_headers.c, soap_headers.len) 
!= soap_headers.len) {

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2010-10-05 11:28:56 UTC (rev 304083)
+++ php/php-src/branches/PHP_5_3/NEWS   2010-10-05 11:43:59 UTC (rev 304084)
@@ -121,6 +121,8 @@
 - Fixed bug #48831 (php -i has different output to php --ini). (Richard,
   Pierre)
 - Fixed bug #45921 (Can't initialize character set hebrew). (Andrey)
+- Fixed bug #44248 (RFC2616 transgression while HTTPS request through proxy
+  with SoapClient object). (Dmitry)

 22 Jul 2010, PHP 5.3.3
 - Upgraded bundled sqlite to version 3.6.23.1. (Ilia)

Modified: php/php-src/branches/PHP_5_3/ext/soap/php_http.c
===
--- php/php-src/branches/PHP_5_3/ext/soap/php_http.c2010-10-05 11:28:56 UTC 
(rev 304083)
+++ php/php-src/branches/PHP_5_3/ext/soap/php_http.c2010-10-05 11:43:59 UTC 
(rev 304084)
@@ -137,6 +137,13 @@
smart_str_appendc(soap_headers, ':');
smart_str_append_unsigned(soap_headers, phpurl-port);
smart_str_append_const(soap_headers,  HTTP/1.1\r\n);
+   smart_str_append_const(soap_headers, Host: );
+   smart_str_appends(soap_headers, phpurl-host);
+   if (phpurl-port != 80) {
+   smart_str_appendc(soap_headers, ':');
+   smart_str_append_unsigned(soap_headers, phpurl-port);
+   }
+   smart_str_append_const(soap_headers, \r\n);
proxy_authentication(this_ptr, soap_headers TSRMLS_CC);
smart_str_append_const(soap_headers, \r\n);
if (php_stream_write(stream, soap_headers.c, soap_headers.len) 
!= soap_headers.len) {

Modified: php/php-src/trunk/ext/soap/php_http.c
===
--- php/php-src/trunk/ext/soap/php_http.c   2010-10-05 11:28:56 UTC (rev 
304083)
+++ php/php-src/trunk/ext/soap/php_http.c   2010-10-05 11:43:59 UTC (rev 
304084)
@@ -137,6 +137,13 @@
smart_str_appendc(soap_headers, ':');
smart_str_append_unsigned(soap_headers, phpurl-port);
smart_str_append_const(soap_headers,  HTTP/1.1\r\n);
+   smart_str_append_const(soap_headers, Host: );
+   smart_str_appends(soap_headers, phpurl-host);
+   if (phpurl-port != 80) {
+   smart_str_appendc(soap_headers, ':');
+   

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

2010-01-04 Thread Sriram Natarajan
srinatar Tue, 05 Jan 2010 03:07:43 +

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

Log:
- Fixed bug #48590 (SoapClient does not honor max_redirects)

Bug: http://bugs.php.net/48590 (Closed) SOAP Client (redirect loop)
  
Changed paths:
U   php/php-src/branches/PHP_5_2/NEWS
U   php/php-src/branches/PHP_5_2/ext/soap/php_http.c
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/soap/php_http.c
U   php/php-src/trunk/ext/soap/php_http.c

Modified: php/php-src/branches/PHP_5_2/NEWS
===
--- php/php-src/branches/PHP_5_2/NEWS   2010-01-05 02:55:24 UTC (rev 293130)
+++ php/php-src/branches/PHP_5_2/NEWS   2010-01-05 03:07:43 UTC (rev 293131)
@@ -24,6 +24,7 @@
   (Jani)
 - Fixed bug #50394 (Reference argument converted to value in __call). (Stas)
 - Fixed bug #49851 (http wrapper breaks on 1024 char long headers). (Ilia)
+- Fixed bug #48590 (SoapClient does not honor max_redirects). (Sriram)
 - Fixed bug #48190 (Content-type parameter boundary is not case-insensitive
   in HTTP uploads). (Ilia)
 - Fixed bug #47409 (extract() problem with array containing word this).

Modified: php/php-src/branches/PHP_5_2/ext/soap/php_http.c
===
--- php/php-src/branches/PHP_5_2/ext/soap/php_http.c2010-01-05 02:55:24 UTC 
(rev 293130)
+++ php/php-src/branches/PHP_5_2/ext/soap/php_http.c2010-01-05 03:07:43 UTC 
(rev 293131)
@@ -237,9 +237,11 @@
int http_1_1;
int http_status;
int content_type_xml = 0;
+   long redirect_max = 20;
char *content_encoding;
char *http_msg = NULL;
zend_bool old_allow_url_fopen;
+   php_stream_context *context = NULL;

if (this_ptr == NULL || Z_TYPE_P(this_ptr) != IS_OBJECT) {
return FALSE;
@@ -307,6 +309,19 @@
phpurl = php_url_parse(location);
}

+   if (SUCCESS == zend_hash_find(Z_OBJPROP_P(this_ptr),
+   _stream_context, sizeof(_stream_context), 
(void**)tmp)) {
+   context = php_stream_context_from_zval(*tmp, 0);
+   }
+
+   if (context 
+   php_stream_context_get_option(context, http, max_redirects, 
tmp) == SUCCESS) {
+   if (Z_TYPE_PP(tmp) != IS_STRING || 
!is_numeric_string(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), redirect_max, NULL, 1)) 
{
+   if (Z_TYPE_PP(tmp) == IS_LONG)
+   redirect_max = Z_LVAL_PP(tmp);
+   }
+   }
+
 try_again:
if (phpurl == NULL || phpurl-host == NULL) {
  if (phpurl != NULL) {php_url_free(phpurl);}
@@ -953,6 +968,12 @@
}
phpurl = new_url;

+   if (--redirect_max  1) {
+   smart_str_free(soap_headers_z);
+   add_soap_fault(this_ptr, HTTP, 
Redirection limit reached, aborting, NULL, NULL TSRMLS_CC);
+   return FALSE;
+   }
+
goto try_again;
}
}

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2010-01-05 02:55:24 UTC (rev 293130)
+++ php/php-src/branches/PHP_5_3/NEWS   2010-01-05 03:07:43 UTC (rev 293131)
@@ -12,6 +12,7 @@
   (Pierrick)
 - Fixed bug #50632 (filter_input() does not return default value if the
   variable does not exist). (Ilia)
+- Fixed bug #48590 (SoapClient does not honor max_redirects). (Sriram)
 - Fixed bug #48190 (Content-type parameter boundary is not case-insensitive
   in HTTP uploads). (Ilia)
 - Fixed bug #47409 (extract() problem with array containing word this).

Modified: php/php-src/branches/PHP_5_3/ext/soap/php_http.c
===
--- php/php-src/branches/PHP_5_3/ext/soap/php_http.c2010-01-05 02:55:24 UTC 
(rev 293130)
+++ php/php-src/branches/PHP_5_3/ext/soap/php_http.c2010-01-05 03:07:43 UTC 
(rev 293131)
@@ -207,6 +207,7 @@
int http_1_1;
int http_status;
int content_type_xml = 0;
+   long redirect_max = 20;
char *content_encoding;
char *http_msg = NULL;
zend_bool old_allow_url_fopen;
@@ -283,6 +284,14 @@
context = php_stream_context_from_zval(*tmp, 0);
}

+   if (context 
+   php_stream_context_get_option(context, http, max_redirects, 
tmp) == SUCCESS) {
+   if (Z_TYPE_PP(tmp) != IS_STRING || 
!is_numeric_string(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), redirect_max, NULL, 1)) 
{
+   if (Z_TYPE_PP(tmp) == IS_LONG)
+   redirect_max = Z_LVAL_PP(tmp);
+   }
+ 

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

2009-11-20 Thread Pierrick Charron
pierrick Sat, 21 Nov 2009 01:22:32 +

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

Log:
Fixed bug #50219 (soap call Segmentation fault on a redirected url).

Bug: http://bugs.php.net/50219 (Open) soap call Segmentation fault on a 
redirected url
  
Changed paths:
U   php/php-src/branches/PHP_5_2/NEWS
U   php/php-src/branches/PHP_5_2/ext/soap/php_http.c
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/soap/php_http.c
U   php/php-src/trunk/ext/soap/php_http.c

Modified: php/php-src/branches/PHP_5_2/NEWS
===
--- php/php-src/branches/PHP_5_2/NEWS   2009-11-21 00:34:37 UTC (rev 291103)
+++ php/php-src/branches/PHP_5_2/NEWS   2009-11-21 01:22:32 UTC (rev 291104)
@@ -6,6 +6,8 @@
 - Changed post_max_size php.ini directive to allow unlimited post size by
   setting it to 0. (Rasmus)

+- Fixed bug #50219 (soap call Segmentation fault on a redirected url).
+  (Pierrick)
 - Fixed bug #50207 (segmentation fault when concatenating very large strings
   on 64bit linux). (Ilia)
 - Fixed bug #50185 (ldap_get_entries() return false instead of an empty array

Modified: php/php-src/branches/PHP_5_2/ext/soap/php_http.c
===
--- php/php-src/branches/PHP_5_2/ext/soap/php_http.c2009-11-21 00:34:37 UTC 
(rev 291103)
+++ php/php-src/branches/PHP_5_2/ext/soap/php_http.c2009-11-21 01:22:32 UTC 
(rev 291104)
@@ -931,12 +931,20 @@
new_url-host = phpurl-host ? 
estrdup(phpurl-host) : NULL;
new_url-port = phpurl-port;
if (new_url-path  new_url-path[0] 
!= '/') {
-   char *t = phpurl-path;
-   char *p = strrchr(t, '/');
-   if (p) {
-   char *s = emalloc((p - 
t) + strlen(new_url-path) + 2);
-   strncpy(s, t, (p - t) + 
1);
-   s[(p - t) + 1] = 0;
+   if (phpurl-path) {
+   char *t = phpurl-path;
+   char *p = strrchr(t, 
'/');
+   if (p) {
+   char *s = 
emalloc((p - t) + strlen(new_url-path) + 2);
+   strncpy(s, t, 
(p - t) + 1);
+   s[(p - t) + 1] 
= 0;
+   strcat(s, 
new_url-path);
+   
efree(new_url-path);
+   new_url-path = 
s;
+   }
+   } else {
+   char *s = 
emalloc(strlen(new_url-path) + 2);
+   s[0] = '/'; s[1] = 0;
strcat(s, 
new_url-path);
efree(new_url-path);
new_url-path = s;

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2009-11-21 00:34:37 UTC (rev 291103)
+++ php/php-src/branches/PHP_5_3/NEWS   2009-11-21 01:22:32 UTC (rev 291104)
@@ -24,6 +24,8 @@
   (Pierre)


+- Fixed bug #50219 (soap call Segmentation fault on a redirected url).
+  (Pierrick)
 - Fixed bug #50212 (crash by ldap_get_option() with LDAP_OPT_NETWORK_TIMEOUT).
   (Ilia, shigeru_kitazaki at cybozu dot co dot jp)
 - Fixed bug #50207 (segmentation fault when concatenating very large strings on

Modified: php/php-src/branches/PHP_5_3/ext/soap/php_http.c
===
--- php/php-src/branches/PHP_5_3/ext/soap/php_http.c2009-11-21 00:34:37 UTC 
(rev 291103)
+++ php/php-src/branches/PHP_5_3/ext/soap/php_http.c2009-11-21 01:22:32 UTC 
(rev 291104)
@@ -990,12 +990,20 @@
new_url-host = phpurl-host ? 
estrdup(phpurl-host) : NULL;
new_url-port = phpurl-port;
if (new_url-path  new_url-path[0] 
!= '/') {
-   char *t = phpurl-path;
-   char *p =