cvs: php4 /ext/session session.c /main SAPI.h main.c php_logos.c php_logos.h php_variables.c /sapi/apache2filter sapi_apache2.c
| From: | Sascha Schumann | Date: | Thu, 02 Nov 2000 15:47:03 +0000 |
| Subject: | cvs: php4 /ext/session session.c /main SAPI.h main.c php_logos.c php_logos.h php_variables.c /sapi/apache2filter sapi_apache2.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-2416@lists.php.net to get a copy of this message | ||
sas Thu Nov 2 07:47:03 2000 EDT
Modified files:
/php4/main php_logos.h php_logos.c main.c SAPI.h php_variables.c
/php4/ext/session session.c
/php4/sapi/apache2filter sapi_apache2.c
Log:
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.
Index: php4/main/php_logos.h
diff -u php4/main/php_logos.h:1.1 php4/main/php_logos.h:1.2
--- php4/main/php_logos.h:1.1 Thu Nov 2 06:18:34 2000
+++ php4/main/php_logos.h Thu Nov 2 07:47:02 2000
@@ -5,6 +5,6 @@
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 */
Index: php4/main/php_logos.c
diff -u php4/main/php_logos.c:1.1 php4/main/php_logos.c:1.2
--- php4/main/php_logos.c:1.1 Thu Nov 2 06:18:34 2000
+++ php4/main/php_logos.c Thu Nov 2 07:47:02 2000
@@ -68,7 +68,7 @@
}
#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;
Index: php4/main/main.c
diff -u php4/main/main.c:1.336 php4/main/main.c:1.337
--- php4/main/main.c:1.336 Thu Nov 2 06:18:34 2000
+++ php4/main/main.c Thu Nov 2 07:47:02 2000
@@ -19,7 +19,7 @@
*/
-/* $Id: main.c,v 1.336 2000/11/02 14:18:34 zeev Exp $ */
+/* $Id: main.c,v 1.337 2000/11/02 15:47:02 sas Exp $ */
#include <stdio.h>
@@ -1140,10 +1140,9 @@
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;
Index: php4/main/SAPI.h
diff -u php4/main/SAPI.h:1.58 php4/main/SAPI.h:1.59
--- php4/main/SAPI.h:1.58 Thu Oct 26 11:18:21 2000
+++ php4/main/SAPI.h Thu Nov 2 07:47:02 2000
@@ -61,17 +61,17 @@
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;
Index: php4/main/php_variables.c
diff -u php4/main/php_variables.c:1.17 php4/main/php_variables.c:1.18
--- php4/main/php_variables.c:1.17 Mon Sep 11 07:50:26 2000
+++ php4/main/php_variables.c Thu Nov 2 07:47:02 2000
@@ -212,6 +212,7 @@
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 @@
}
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;
Index: php4/ext/session/session.c
diff -u php4/ext/session/session.c:1.183 php4/ext/session/session.c:1.184
--- php4/ext/session/session.c:1.183 Mon Oct 30 09:10:05 2000
+++ php4/ext/session/session.c Thu Nov 2 07:47:02 2000
@@ -641,7 +641,7 @@
static void last_modified(void)
{
- char *path;
+ const char *path;
struct stat sb;
char buf[MAX_STR + 1];
SLS_FETCH();
Index: php4/sapi/apache2filter/sapi_apache2.c
diff -u php4/sapi/apache2filter/sapi_apache2.c:1.18 php4/sapi/apache2filter/sapi_apache2.c:1.19
--- php4/sapi/apache2filter/sapi_apache2.c:1.18 Thu Nov 2 07:19:54 2000
+++ php4/sapi/apache2filter/sapi_apache2.c Thu Nov 2 07:47:02 2000
@@ -298,9 +298,9 @@
/* 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);