]> granicus.if.org Git - php/commitdiff
Fixed incorrect HTTP headers in SOAP response
authorDmitry Stogov <dmitry@php.net>
Tue, 20 Jul 2004 07:39:32 +0000 (07:39 +0000)
committerDmitry Stogov <dmitry@php.net>
Tue, 20 Jul 2004 07:39:32 +0000 (07:39 +0000)
ext/soap/soap.c

index fd21af792580dfb72669b35ea4cc5c497148f831..604e1062a5a1528595d8b69429df117f30cfdb9b 100644 (file)
@@ -1262,7 +1262,7 @@ PHP_METHOD(SoapServer, handle)
                                                INIT_ZVAL(readfile_ret);
                                                MAKE_STD_ZVAL(param);
 
-                                               sapi_add_header("Content-Type: text/xml; charset=\"utf-8\"", sizeof("Content-Type: text/xml; charset=\"utf-8\""), 1);
+                                               sapi_add_header("Content-Type: text/xml; charset=\"utf-8\"", sizeof("Content-Type: text/xml; charset=\"utf-8\"")-1, 1);
                                                ZVAL_STRING(param, service->sdl->source, 1);
                                                ZVAL_STRING(&readfile, "readfile", 1);
                                                if (call_user_function(EG(function_table), NULL, &readfile, &readfile_ret, 1, &param  TSRMLS_CC) == FAILURE) {
@@ -1623,11 +1623,11 @@ PHP_METHOD(SoapServer, handle)
        }
 
        sprintf(cont_len, "Content-Length: %d", size);
-       sapi_add_header(cont_len, strlen(cont_len) + 1, 1);
+       sapi_add_header(cont_len, strlen(cont_len), 1);
        if (soap_version == SOAP_1_2) {
-               sapi_add_header("Content-Type: application/soap+xml; charset=\"utf-8\"", sizeof("Content-Type: application/soap+xml; charset=\"utf-8\""), 1);
+               sapi_add_header("Content-Type: application/soap+xml; charset=\"utf-8\"", sizeof("Content-Type: application/soap+xml; charset=\"utf-8\"")-1, 1);
        } else {
-               sapi_add_header("Content-Type: text/xml; charset=\"utf-8\"", sizeof("Content-Type: text/xml; charset=\"utf-8\""), 1);
+               sapi_add_header("Content-Type: text/xml; charset=\"utf-8\"", sizeof("Content-Type: text/xml; charset=\"utf-8\"")-1, 1);
        }
 
        xmlFreeDoc(doc_return);
@@ -1707,13 +1707,13 @@ static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeade
           Want to return HTTP 500 but apache wants to over write
           our fault code with their own handling... Figure this out later
        */
-       sapi_add_header("HTTP/1.1 500 Internal Service Error", sizeof("HTTP/1.1 500 Internal Service Error"), 1);
+       sapi_add_header("HTTP/1.1 500 Internal Service Error", sizeof("HTTP/1.1 500 Internal Service Error")-1, 1);
        sprintf(cont_len,"Content-Length: %d", size);
-       sapi_add_header(cont_len, strlen(cont_len) + 1, 1);
+       sapi_add_header(cont_len, strlen(cont_len), 1);
        if (soap_version == SOAP_1_2) {
-               sapi_add_header("Content-Type: application/soap+xml; charset=\"utf-8\"", sizeof("Content-Type: application/soap+xml; charset=\"utf-8\""), 1);
+               sapi_add_header("Content-Type: application/soap+xml; charset=\"utf-8\"", sizeof("Content-Type: application/soap+xml; charset=\"utf-8\"")-1, 1);
        } else {
-               sapi_add_header("Content-Type: text/xml; charset=\"utf-8\"", sizeof("Content-Type: text/xml; charset=\"utf-8\""), 1);
+               sapi_add_header("Content-Type: text/xml; charset=\"utf-8\"", sizeof("Content-Type: text/xml; charset=\"utf-8\"")-1, 1);
        }
        php_write(buf, size TSRMLS_CC);