mirror of
https://github.com/php/php-src.git
synced 2024-12-18 06:21:41 +08:00
Const'ify part of sapi_request_info.
query_string, post_data, path_translated, request_uri, auth_user, auth_password and argv0 are modified, so they cannot become const.
This commit is contained in:
parent
9866d899e9
commit
43ff395b65
@ -641,7 +641,7 @@ static void strcat_gmt(char *ubuf, time_t *when)
|
||||
|
||||
static void last_modified(void)
|
||||
{
|
||||
char *path;
|
||||
const char *path;
|
||||
struct stat sb;
|
||||
char buf[MAX_STR + 1];
|
||||
SLS_FETCH();
|
||||
|
@ -61,17 +61,17 @@ extern sapi_module_struct sapi_module; /* true global */
|
||||
|
||||
|
||||
typedef struct {
|
||||
char *request_method;
|
||||
const char *request_method;
|
||||
char *query_string;
|
||||
char *post_data;
|
||||
char *cookie_data;
|
||||
const char *cookie_data;
|
||||
long content_length;
|
||||
uint post_data_length;
|
||||
|
||||
char *path_translated;
|
||||
char *request_uri;
|
||||
|
||||
char *content_type;
|
||||
const char *content_type;
|
||||
|
||||
unsigned char headers_only;
|
||||
|
||||
|
@ -1140,10 +1140,9 @@ static void php_build_argv(char *s, zval *track_vars_array ELS_DC PLS_DC)
|
||||
PHPAPI int php_handle_special_queries(SLS_D PLS_DC)
|
||||
{
|
||||
if (SG(request_info).query_string && SG(request_info).query_string[0]=='='
|
||||
&& PG(expose_php)) {
|
||||
if(php_info_logos(SG(request_info).query_string+1))
|
||||
{
|
||||
return 1;
|
||||
&& PG(expose_php)) {
|
||||
if (php_info_logos(SG(request_info).query_string+1)) {
|
||||
return 1;
|
||||
} else if (!strcmp(SG(request_info).query_string+1, PHP_CREDITS_GUID)) {
|
||||
php_print_credits(PHP_CREDITS_ALL);
|
||||
return 1;
|
||||
|
@ -68,7 +68,7 @@ int php_shutdown_info_logos(void)
|
||||
}
|
||||
|
||||
#define CONTENT_TYPE_HEADER "Content-Type: "
|
||||
int php_info_logos(char *logo_string)
|
||||
int php_info_logos(const char *logo_string)
|
||||
{
|
||||
php_info_logo *logo_image;
|
||||
char *content_header;
|
||||
|
@ -5,6 +5,6 @@ PHPAPI int php_register_info_logo(char *logo_string, char *mimetype, unsigned ch
|
||||
PHPAPI int php_unregister_info_logos(char *logo_string);
|
||||
int php_init_info_logos(void);
|
||||
int php_shutdown_info_logos(void);
|
||||
int php_info_logos(char *logo_string);
|
||||
int php_info_logos(const char *logo_string);
|
||||
|
||||
#endif /* _PHP_LOGOS_H */
|
||||
|
@ -212,6 +212,7 @@ SAPI_POST_HANDLER_FUNC(php_std_post_handler)
|
||||
void php_treat_data(int arg, char *str, zval* destArray ELS_DC PLS_DC SLS_DC)
|
||||
{
|
||||
char *res = NULL, *var, *val;
|
||||
const char *c_var;
|
||||
pval *array_ptr;
|
||||
int free_buffer=0;
|
||||
char *strtok_buf = NULL;
|
||||
@ -246,17 +247,17 @@ void php_treat_data(int arg, char *str, zval* destArray ELS_DC PLS_DC SLS_DC)
|
||||
}
|
||||
|
||||
if (arg == PARSE_GET) { /* GET data */
|
||||
var = SG(request_info).query_string;
|
||||
if (var && *var) {
|
||||
res = (char *) estrdup(var);
|
||||
c_var = SG(request_info).query_string;
|
||||
if (c_var && *c_var) {
|
||||
res = (char *) estrdup(c_var);
|
||||
free_buffer = 1;
|
||||
} else {
|
||||
free_buffer = 0;
|
||||
}
|
||||
} else if (arg == PARSE_COOKIE) { /* Cookie data */
|
||||
var = SG(request_info).cookie_data;
|
||||
if (var && *var) {
|
||||
res = (char *) estrdup(var);
|
||||
c_var = SG(request_info).cookie_data;
|
||||
if (c_var && *c_var) {
|
||||
res = (char *) estrdup(c_var);
|
||||
free_buffer = 1;
|
||||
} else {
|
||||
free_buffer = 0;
|
||||
|
@ -298,9 +298,9 @@ static int php_output_filter(ap_filter_t *f, ap_bucket_brigade *bb)
|
||||
/* XXX: Lots of startup crap. Should be moved into its own func */
|
||||
PG(during_request_startup) = 0;
|
||||
SG(sapi_headers).http_response_code = 200;
|
||||
SG(request_info).content_type = (char *) apr_table_get(f->r->headers_in, "Content-Type");
|
||||
SG(request_info).content_type = apr_table_get(f->r->headers_in, "Content-Type");
|
||||
SG(request_info).query_string = f->r->args;
|
||||
SG(request_info).request_method = (char *) f->r->method;
|
||||
SG(request_info).request_method = f->r->method;
|
||||
SG(request_info).request_uri = f->r->uri;
|
||||
f->r->no_cache = f->r->no_local_copy = 1;
|
||||
content_type = sapi_get_default_content_type(SLS_C);
|
||||
|
Loading…
Reference in New Issue
Block a user