dmitry          Thu Nov  1 15:41:14 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/soap   soap.c 
  Log:
  Another fix for bug #42773
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/soap.c?r1=1.156.2.28.2.32&r2=1.156.2.28.2.33&diff_format=u
Index: php-src/ext/soap/soap.c
diff -u php-src/ext/soap/soap.c:1.156.2.28.2.32 
php-src/ext/soap/soap.c:1.156.2.28.2.33
--- php-src/ext/soap/soap.c:1.156.2.28.2.32     Thu Nov  1 14:11:47 2007
+++ php-src/ext/soap/soap.c     Thu Nov  1 15:41:13 2007
@@ -17,7 +17,7 @@
   |          Dmitry Stogov <[EMAIL PROTECTED]>                             |
   +----------------------------------------------------------------------+
 */
-/* $Id: soap.c,v 1.156.2.28.2.32 2007/11/01 14:11:47 dmitry Exp $ */
+/* $Id: soap.c,v 1.156.2.28.2.33 2007/11/01 15:41:13 dmitry Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -2071,14 +2071,17 @@
 
 static void soap_error_handler(int error_num, const char *error_filename, 
const uint error_lineno, const char *format, va_list args)
 {
-       zend_bool _old_in_compilation, _old_in_execution, _old_headers_sent;
+       zend_bool _old_in_compilation, _old_in_execution;
        zend_execute_data *_old_current_execute_data;
+       int _old_http_response_code;
+       char *_old_http_status_line;
        TSRMLS_FETCH();
 
        _old_in_compilation = CG(in_compilation);
        _old_in_execution = EG(in_execution);
        _old_current_execute_data = EG(current_execute_data);
-       _old_headers_sent = SG(headers_sent);
+       _old_http_response_code = SG(sapi_headers).http_response_code;
+       _old_http_status_line = SG(sapi_headers).http_status_line;
 
        if (!SOAP_GLOBAL(use_soap_error_handler)) {
                call_old_error_handler(error_num, error_filename, error_lineno, 
format, args);
@@ -2136,14 +2139,18 @@
                        old_objects = EG(objects_store).object_buckets;
                        EG(objects_store).object_buckets = NULL;
                        PG(display_errors) = 0;
-                       SG(headers_sent) = 1;
+                       SG(sapi_headers).http_status_line = NULL;
                        zend_try {
                                call_old_error_handler(error_num, 
error_filename, error_lineno, format, args);
                        } zend_catch {
                                CG(in_compilation) = _old_in_compilation;
                                EG(in_execution) = _old_in_execution;
                                EG(current_execute_data) = 
_old_current_execute_data;
-                               SG(headers_sent) = _old_headers_sent;
+                               if (SG(sapi_headers).http_status_line) {
+                                       
efree(SG(sapi_headers).http_status_line);
+                               }
+                               SG(sapi_headers).http_status_line = 
_old_http_status_line;
+                               SG(sapi_headers).http_response_code = 
_old_http_response_code;
                        } zend_end_try();
                        EG(objects_store).object_buckets = old_objects;
                        PG(display_errors) = old;
@@ -2216,14 +2223,18 @@
                }
 
                PG(display_errors) = 0;
-               SG(headers_sent) = 1;
+               SG(sapi_headers).http_status_line = NULL;
                zend_try {
                        call_old_error_handler(error_num, error_filename, 
error_lineno, format, args);
                } zend_catch {
                        CG(in_compilation) = _old_in_compilation;
                        EG(in_execution) = _old_in_execution;
                        EG(current_execute_data) = _old_current_execute_data;
-                       SG(headers_sent) = _old_headers_sent;
+                       if (SG(sapi_headers).http_status_line) {
+                               efree(SG(sapi_headers).http_status_line);
+                       }
+                       SG(sapi_headers).http_status_line = 
_old_http_status_line;
+                       SG(sapi_headers).http_response_code = 
_old_http_response_code;
                } zend_end_try();
                PG(display_errors) = old;
 

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

Reply via email to