[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/soap php_http.c

2009-06-03 Thread Ilia Alshanetsky
iliaa   Wed Jun  3 12:41:47 2009 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/soap   php_http.c 
/php-srcNEWS 
  Log:
  
  MFB: Fixed bug #46386 (Digest authentication with SOAP module fails against
  MSSQL SOAP services)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_http.c?r1=1.77.2.11.2.17&r2=1.77.2.11.2.18&diff_format=u
Index: php-src/ext/soap/php_http.c
diff -u php-src/ext/soap/php_http.c:1.77.2.11.2.17 
php-src/ext/soap/php_http.c:1.77.2.11.2.18
--- php-src/ext/soap/php_http.c:1.77.2.11.2.17  Mon Jan 19 21:57:45 2009
+++ php-src/ext/soap/php_http.c Wed Jun  3 12:41:46 2009
@@ -17,7 +17,7 @@
   |  Dmitry Stogov  |
   +--+
 */
-/* $Id: php_http.c,v 1.77.2.11.2.17 2009/01/19 21:57:45 iliaa Exp $ */
+/* $Id: php_http.c,v 1.77.2.11.2.18 2009/06/03 12:41:46 iliaa Exp $ */
 
 #include "php_soap.h"
 #include "ext/standard/base64.h"
@@ -614,6 +614,11 @@

smart_str_append_const(&soap_headers, "\", opaque=\"");

smart_str_appendl(&soap_headers, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
}
+   if (zend_hash_find(Z_ARRVAL_PP(digest), 
"algorithm", sizeof("algorithm"), (void **)&tmp) == SUCCESS &&
+   Z_TYPE_PP(tmp) == IS_STRING) {
+   
smart_str_append_const(&soap_headers, "\", algorithm=\"");
+   
smart_str_appendl(&soap_headers, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
+   }
smart_str_append_const(&soap_headers, 
"\"\r\n");
}
} else {
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1540&r2=1.2027.2.547.2.1541&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1540 php-src/NEWS:1.2027.2.547.2.1541
--- php-src/NEWS:1.2027.2.547.2.1540Wed Jun  3 08:59:19 2009
+++ php-src/NEWSWed Jun  3 12:41:46 2009
@@ -19,6 +19,8 @@
 - Fixed bug #48273 (snmp*_real_walk() returns SNMP errors as values).
   (Ilia, lytboris at gmail dot com)
 - Fixed bug #48247 (Crash on errors during startup). (Stas)
+- Fixed bug #46386 (Digest authentication with SOAP module fails against MSSQL 
+  SOAP services). (Ilia, lordelph at gmail dot com)
 - Fixed bug #42143 (The constant NAN is reported as 0 on Windows)
   (Kanwaljeet Singla, Venkat Raman Don)
 



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



Re: [PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/soap php_http.c

2009-01-19 Thread Hannes Magnusson
On Mon, Jan 19, 2009 at 22:57, Ilia Alshanetsky  wrote:
> iliaa   Mon Jan 19 21:57:47 2009 UTC
>
>  Modified files:  (Branch: PHP_5_2)
>/php-src/ext/soap   php_http.c
>/php-srcNEWS
>  Log:
>  Fixed bug #47131 (SOAP Extension ignores "user_agent" ini setting).
>
>
> http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_http.c?r1=1.77.2.11.2.16&r2=1.77.2.11.2.17&diff_format=u
> Index: php-src/ext/soap/php_http.c
> diff -u php-src/ext/soap/php_http.c:1.77.2.11.2.16 
> php-src/ext/soap/php_http.c:1.77.2.11.2.17
> --- php-src/ext/soap/php_http.c:1.77.2.11.2.16  Wed Dec 31 11:17:43 2008
> +++ php-src/ext/soap/php_http.c Mon Jan 19 21:57:45 2009
> @@ -17,7 +17,7 @@
>   |  Dmitry Stogov  |
>   +--+
>  */
> -/* $Id: php_http.c,v 1.77.2.11.2.16 2008/12/31 11:17:43 sebastian Exp $ */
> +/* $Id: php_http.c,v 1.77.2.11.2.17 2009/01/19 21:57:45 iliaa Exp $ */
>
>  #include "php_soap.h"
>  #include "ext/standard/base64.h"
> @@ -438,7 +438,11 @@
>smart_str_appendl(&soap_headers, 
> Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
>smart_str_append_const(&soap_headers, "\r\n");
>}
> -   } else{
> +   } else if (FG(user_agent)) {
> +   smart_str_append_const(&soap_headers, "User-Agent: ");
> +   smart_str_appends(&soap_headers, FG(user_agent));
> +   smart_str_append_const(&soap_headers, "\r\n");
> +   } else {
>smart_str_append_const(&soap_headers, "User-Agent: 
> PHP-SOAP/"PHP_VERSION"\r\n");
>}

Why not check the context for user_agent while you are at it?

-Hannes

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



[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/soap php_http.c

2009-01-19 Thread Ilia Alshanetsky
iliaa   Mon Jan 19 21:57:47 2009 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/soap   php_http.c 
/php-srcNEWS 
  Log:
  Fixed bug #47131 (SOAP Extension ignores "user_agent" ini setting).
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_http.c?r1=1.77.2.11.2.16&r2=1.77.2.11.2.17&diff_format=u
Index: php-src/ext/soap/php_http.c
diff -u php-src/ext/soap/php_http.c:1.77.2.11.2.16 
php-src/ext/soap/php_http.c:1.77.2.11.2.17
--- php-src/ext/soap/php_http.c:1.77.2.11.2.16  Wed Dec 31 11:17:43 2008
+++ php-src/ext/soap/php_http.c Mon Jan 19 21:57:45 2009
@@ -17,7 +17,7 @@
   |  Dmitry Stogov  |
   +--+
 */
-/* $Id: php_http.c,v 1.77.2.11.2.16 2008/12/31 11:17:43 sebastian Exp $ */
+/* $Id: php_http.c,v 1.77.2.11.2.17 2009/01/19 21:57:45 iliaa Exp $ */
 
 #include "php_soap.h"
 #include "ext/standard/base64.h"
@@ -438,7 +438,11 @@
smart_str_appendl(&soap_headers, 
Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
smart_str_append_const(&soap_headers, "\r\n");
}
-   } else{
+   } else if (FG(user_agent)) {
+   smart_str_append_const(&soap_headers, "User-Agent: ");
+   smart_str_appends(&soap_headers, FG(user_agent));
+   smart_str_append_const(&soap_headers, "\r\n");
+   } else {
smart_str_append_const(&soap_headers, "User-Agent: 
PHP-SOAP/"PHP_VERSION"\r\n");
}
 
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1396&r2=1.2027.2.547.2.1397&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1396 php-src/NEWS:1.2027.2.547.2.1397
--- php-src/NEWS:1.2027.2.547.2.1396Sun Jan 18 23:51:15 2009
+++ php-src/NEWSMon Jan 19 21:57:46 2009
@@ -17,6 +17,7 @@
 - Fixed bug in xml_error_string() which resulted in messages being
   off by one. (Scott)
 
+- Fixed bug #47131 (SOAP Extension ignores "user_agent" ini setting). (Ilia)
 - Fixed bug #47104 (Linking shared extensions fails with icc). (Jani)
 - Fixed bug #47109 (Memory leak on $a->{"a"."b"} when $a is not an object).
   (Etienne, Dmitry)



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



[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/soap php_http.c

2007-10-17 Thread Dmitry Stogov
dmitry  Wed Oct 17 11:17:46 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/ext/soap   php_http.c 
  Log:
  Fixed bug #42637 (SoapFault : Only http and https are allowed)
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.974&r2=1.2027.2.547.2.975&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.974 php-src/NEWS:1.2027.2.547.2.975
--- php-src/NEWS:1.2027.2.547.2.974 Thu Oct 11 20:56:22 2007
+++ php-src/NEWSWed Oct 17 11:17:46 2007
@@ -52,6 +52,7 @@
   enabled). (Ilia)
 - Fixed bug #42699 (PHP_SELF duplicates path). (Dmitry)
 - Fixed bug #42643 (CLI segfaults if using ATTR_PERSISTENT). (Ilia)
+- Fixed bug #42637 (SoapFault : Only http and https are allowed). (Bill Moran)
 - Fixed bug #42629 (Dynamically loaded PHP extensions need symbols exported
   on MacOSX). (jdolecek at NetBSD dot org)
 - Fixed bug #42627 (bz2 extension fails to build with -fno-common).
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_http.c?r1=1.77.2.11.2.12&r2=1.77.2.11.2.13&diff_format=u
Index: php-src/ext/soap/php_http.c
diff -u php-src/ext/soap/php_http.c:1.77.2.11.2.12 
php-src/ext/soap/php_http.c:1.77.2.11.2.13
--- php-src/ext/soap/php_http.c:1.77.2.11.2.12  Tue Jul 24 09:27:46 2007
+++ php-src/ext/soap/php_http.c Wed Oct 17 11:17:46 2007
@@ -17,7 +17,7 @@
   |  Dmitry Stogov <[EMAIL PROTECTED]> |
   +--+
 */
-/* $Id: php_http.c,v 1.77.2.11.2.12 2007/07/24 09:27:46 dmitry Exp $ */
+/* $Id: php_http.c,v 1.77.2.11.2.13 2007/10/17 11:17:46 dmitry Exp $ */
 
 #include "php_soap.h"
 #include "ext/standard/base64.h"
@@ -918,7 +918,7 @@
efree(http_body);
efree(loc);
if (new_url->scheme == NULL && new_url->path != 
NULL) {
-   new_url->scheme = NULL;
+   new_url->scheme = phpurl->scheme ? 
estrdup(phpurl->scheme) : NULL;
new_url->host = phpurl->host ? 
estrdup(phpurl->host) : NULL;
new_url->port = phpurl->port;
if (new_url->path && new_url->path[0] 
!= '/') {

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



[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/soap php_http.c

2007-07-24 Thread Dmitry Stogov
dmitry  Tue Jul 24 09:27:47 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/ext/soap   php_http.c 
  Log:
  Fixed bug #41983 (Error Fetching http headers terminated by '\n')
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.848&r2=1.2027.2.547.2.849&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.848 php-src/NEWS:1.2027.2.547.2.849
--- php-src/NEWS:1.2027.2.547.2.848 Tue Jul 24 09:26:34 2007
+++ php-src/NEWSTue Jul 24 09:27:46 2007
@@ -68,6 +68,7 @@
 - Fixed bug #42015 (ldap_rename(): server error "DSA is unwilling to perform").
   (bob at mroczka dot com, Jani)
 - Fixed bug #41989 (move_uploaded_file() & relative path in ZTS mode). (Tony)
+- Fixed bug #41983 (Error Fetching http headers terminated by '\n'). (Dmitry)
 - Fixed bug #41964 (strtotime returns a timestamp for non-time string of
   pattern '(A|a) .+'). (Derick)
 - Fixed bug #41961 (Ensure search for hidden private methods does not stray
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_http.c?r1=1.77.2.11.2.11&r2=1.77.2.11.2.12&diff_format=u
Index: php-src/ext/soap/php_http.c
diff -u php-src/ext/soap/php_http.c:1.77.2.11.2.11 
php-src/ext/soap/php_http.c:1.77.2.11.2.12
--- php-src/ext/soap/php_http.c:1.77.2.11.2.11  Fri Jul 13 09:14:03 2007
+++ php-src/ext/soap/php_http.c Tue Jul 24 09:27:46 2007
@@ -17,7 +17,7 @@
   |  Dmitry Stogov <[EMAIL PROTECTED]> |
   +--+
 */
-/* $Id: php_http.c,v 1.77.2.11.2.11 2007/07/13 09:14:03 dmitry Exp $ */
+/* $Id: php_http.c,v 1.77.2.11.2.12 2007/07/24 09:27:46 dmitry Exp $ */
 
 #include "php_soap.h"
 #include "ext/standard/base64.h"
@@ -1153,17 +1153,19 @@
 
/* match */
tmp = pos + typelen;
-   eol = strstr(tmp, "\r\n");
+   eol = strchr(tmp, '\n');
if (eol == NULL) {
eol = headers + headerslen;
+   } else if (eol > tmp && *(eol-1) == '\r') {
+   eol--;
}
return estrndup(tmp, eol - tmp);
}
 
/* find next line */
-   pos = strstr(pos, "\r\n");
+   pos = strchr(pos, '\n');
if (pos) {
-   pos += 2;
+   pos++;
}
 
} while (pos);
@@ -1203,7 +1205,7 @@
}
 
if (header_chunked) {
-   char done, chunk_size[10];
+   char ch, done, chunk_size[10], headerbuf[8192];
 
done = FALSE;
 
@@ -1231,11 +1233,20 @@
len_size += len_read;
http_buf_size += len_read;
}
-   }
 
-   /* Eat up '\r' '\n' */
-   php_stream_getc(stream);
-   php_stream_getc(stream);
+   /* Eat up '\r' '\n' */
+   ch = php_stream_getc(stream);
+   if (ch == '\r') {
+   ch = php_stream_getc(stream);
+   }
+   if (ch != '\n') {
+   /* Somthing wrong in chunked 
encoding */
+   if (http_buf) {
+   efree(http_buf);
+   }
+   return FALSE;
+   }
+   }
} else {
/* Somthing wrong in chunked encoding */
if (http_buf) {
@@ -1248,6 +1259,19 @@
}
}
 
+   /* Ignore trailer headers */
+   while (1) {
+   if (!php_stream_gets(stream, headerbuf, 
sizeof(headerbuf))) {
+   break;
+   }
+
+   if ((headerbuf[0] == '\r' && headerbuf[1] == '\n') ||
+   (headerbuf[0] == '\n')) {
+   /* empty line marks end of headers */
+   break;
+   }
+   }
+
if (http_buf == NULL) {
http_buf = emalloc(1);
}
@@ -1294,7 +1318,8 @@
break;
}
 
-   if (strcmp(headerbuf, "\r\n") == 0) {
+   if ((headerbuf[0] == '\r' && headerbuf[1] == '\n') ||
+ 

[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/soap php_http.c

2006-06-27 Thread Ilia Alshanetsky
iliaa   Tue Jun 27 23:32:56 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/soap   php_http.c 
/php-srcNEWS 
  Log:
  Improved the error reporting in SOAP extension on request failure.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_http.c?r1=1.77.2.11&r2=1.77.2.11.2.1&diff_format=u
Index: php-src/ext/soap/php_http.c
diff -u php-src/ext/soap/php_http.c:1.77.2.11 
php-src/ext/soap/php_http.c:1.77.2.11.2.1
--- php-src/ext/soap/php_http.c:1.77.2.11   Thu Apr 13 08:18:36 2006
+++ php-src/ext/soap/php_http.c Tue Jun 27 23:32:56 2006
@@ -17,7 +17,7 @@
   |  Dmitry Stogov <[EMAIL PROTECTED]> |
   +--+
 */
-/* $Id: php_http.c,v 1.77.2.11 2006/04/13 08:18:36 dmitry Exp $ */
+/* $Id: php_http.c,v 1.77.2.11.2.1 2006/06/27 23:32:56 iliaa Exp $ */
 
 #include "php_soap.h"
 #include "ext/standard/base64.h"
@@ -237,6 +237,7 @@
int http_status;
int content_type_xml = 0;
char *content_encoding;
+   char *http_msg = NULL;
zend_bool old_allow_url_fopen;
 
if (this_ptr == NULL || Z_TYPE_P(this_ptr) != IS_OBJECT) {
@@ -729,6 +730,14 @@
tmp++;
http_status = atoi(tmp);
}
+   tmp = strstr(tmp," ");
+   if (tmp != NULL) {
+   tmp++;
+   if (http_msg) {
+   efree(http_msg);
+   }
+   http_msg = estrdup(tmp);
+   }
efree(http_version);
 
/* Try and get headers again */
@@ -842,6 +851,9 @@
zend_hash_del(Z_OBJPROP_P(this_ptr), "httpsocket", 
sizeof("httpsocket"));
zend_hash_del(Z_OBJPROP_P(this_ptr), "_use_proxy", 
sizeof("_use_proxy"));
add_soap_fault(this_ptr, "HTTP", "Error Fetching http body, No 
Content-Length, connection closed or chunked data", NULL, NULL TSRMLS_CC);
+   if (http_msg) {
+   efree(http_msg);
+   }
return FALSE;
}
 
@@ -1044,6 +1056,9 @@
efree(content_encoding);
efree(http_headers);
efree(http_body);
+   if (http_msg) {
+   efree(http_msg);
+   }
add_soap_fault(this_ptr, "HTTP", "Unknown 
Content-Encoding", NULL, NULL TSRMLS_CC);
return FALSE;
}
@@ -1057,6 +1072,9 @@
efree(http_headers);
efree(http_body);
add_soap_fault(this_ptr, "HTTP", "Can't uncompress 
compressed response", NULL, NULL TSRMLS_CC);
+   if (http_msg) {
+   efree(http_msg);
+   }
return FALSE;
}
efree(content_encoding);
@@ -1087,27 +1105,16 @@
 
if (error) {
efree(*buffer);
-   if (http_status == 400) {
-   add_soap_fault(this_ptr, "HTTP", "Bad Request", 
NULL, NULL TSRMLS_CC);
-   } else if (http_status == 401) {
-   add_soap_fault(this_ptr, "HTTP", "Unauthorized 
Request", NULL, NULL TSRMLS_CC);
-   } else if (http_status == 405) {
-   add_soap_fault(this_ptr, "HTTP", "Method not 
allowed", NULL, NULL TSRMLS_CC);
-   } else if (http_status == 415) {
-   add_soap_fault(this_ptr, "HTTP", "Unsupported 
Media Type", NULL, NULL TSRMLS_CC);
-   } else if (http_status >= 400 && http_status < 500) {
-   add_soap_fault(this_ptr, "HTTP", "Client 
Error", NULL, NULL TSRMLS_CC);
-   } else if (http_status == 500) {
-   add_soap_fault(this_ptr, "HTTP", "Internal 
Server Error", NULL, NULL TSRMLS_CC);
-   } else if (http_status >= 500 && http_status < 600) {
-   add_soap_fault(this_ptr, "HTTP", "Server 
Error", NULL, NULL TSRMLS_CC);
-   } else {
-   add_soap_fault(this_ptr, "HTTP", "Unsupported 
HTTP status code", NULL, NULL TSRMLS_CC);
-   }
+   add_soap_fault(this_ptr, "HTTP", http_msg, NULL, NULL 
TSRMLS_CC);
+   efree(http_msg);
return FALSE;
}
}
 
+   if (http_msg) {
+   efree(http_msg);
+   }
+
return TRUE;
 }
 
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=