diff options
Diffstat (limited to 'sapi')
| -rw-r--r-- | sapi/pi3web/pi3web_sapi.c | 12 | ||||
| -rw-r--r-- | sapi/tux/php_tux.c | 8 | ||||
| -rw-r--r-- | sapi/webjames/webjames.c | 18 |
3 files changed, 14 insertions, 24 deletions
diff --git a/sapi/pi3web/pi3web_sapi.c b/sapi/pi3web/pi3web_sapi.c index a7176a1b2a..83fe5fdef7 100644 --- a/sapi/pi3web/pi3web_sapi.c +++ b/sapi/pi3web/pi3web_sapi.c @@ -422,9 +422,14 @@ DWORD PHP4_wrapper(LPCONTROL_BLOCK lpCB) }; }; break; - case PHP_MODE_INDENT: - header_line = (char *)estrdup("Content-Type: text/plain"); - sapi_add_header_ex(header_line, strlen(header_line), 1, 1, 0 TSRMLS_CC); + case PHP_MODE_INDENT: { + sapi_header_line ctr = {0}; + + ctr.line = "Content-Type: text/plain"; + ctr.line_len = strlen(ctr.line); + + sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC); + } if ( open_file_for_scanning( &file_handle TSRMLS_CC ) == SUCCESS ) { zend_indent(); @@ -433,7 +438,6 @@ DWORD PHP4_wrapper(LPCONTROL_BLOCK lpCB) { iRet = PIAPI_ERROR; }; - efree(header_line); break; case PHP_MODE_LINT: iRet = (php_lint_script(&file_handle TSRMLS_CC) == SUCCESS) ? diff --git a/sapi/tux/php_tux.c b/sapi/tux/php_tux.c index d2da64882a..4f0b6e17db 100644 --- a/sapi/tux/php_tux.c +++ b/sapi/tux/php_tux.c @@ -192,10 +192,12 @@ static void sapi_tux_register_variables(zval *track_vars_array TSRMLS_DC) { char buf[BUF_SIZE + 1]; char *p; - + sapi_header_line ctr = {0}; + + ctr.line = buf; + ctr.line_len = sprintf(buf, "Server: %s", TUXAPI_version); + sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC); - sprintf(buf, "Server: %s", TUXAPI_version); - sapi_add_header_ex(buf, strlen(buf), 1, 0, 0 TSRMLS_CC); php_register_variable("PHP_SELF", SG(request_info).request_uri, track_vars_array TSRMLS_CC); php_register_variable("SERVER_SOFTWARE", TUXAPI_version, track_vars_array TSRMLS_CC); php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array TSRMLS_CC); diff --git a/sapi/webjames/webjames.c b/sapi/webjames/webjames.c index 1aba413dee..3bea3457e4 100644 --- a/sapi/webjames/webjames.c +++ b/sapi/webjames/webjames.c @@ -54,22 +54,6 @@ static int sapi_webjames_ub_write(const char *str, uint str_length TSRMLS_DC) return bytes; } -static int sapi_webjames_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) -/*send the HTTP response line*/ -{ - char buf[256]; - - if (WG(conn)->flags.outputheaders) { - if (!SG(sapi_headers).http_status_line) { - int code=SG(sapi_headers).http_response_code; - snprintf(buf, 255, "HTTP/1.0 %d %s\r\n", code, code==200 ? "OK" : code==302 ? "Moved temporarily" : "Something"); - webjames_writestring(WG(conn), buf); - } - } - - return SAPI_HEADER_DO_SEND; -} - static void sapi_webjames_send_header(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC) /*send an HTTP header*/ { @@ -286,7 +270,7 @@ static sapi_module_struct sapi_module = { php_error, /* error handler */ NULL, /* header handler */ - sapi_webjames_send_headers, /* send headers handler */ + NULL, /* send headers handler */ sapi_webjames_send_header, /* send header handler */ sapi_webjames_read_post, /* read POST data */ sapi_webjames_read_cookies, /* read Cookies */ |
