[PHP-CVS] cvs: php4 /sapi/apache2filter sapi_apache2.c /sapi/apache2handler sapi_apache2.c

2003-03-05 Thread Jani Taskinen
sniper  Wed Mar  5 11:12:23 2003 EDT

  Modified files:  
/php4/sapi/apache2filtersapi_apache2.c 
/php4/sapi/apache2handler   sapi_apache2.c 
  Log:
  - Fix for some unixware compile problem. (comment by Sascha :)
  
  
Index: php4/sapi/apache2filter/sapi_apache2.c
diff -u php4/sapi/apache2filter/sapi_apache2.c:1.105 
php4/sapi/apache2filter/sapi_apache2.c:1.106
--- php4/sapi/apache2filter/sapi_apache2.c:1.105Mon Feb 24 10:10:36 2003
+++ php4/sapi/apache2filter/sapi_apache2.c  Wed Mar  5 11:12:23 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: sapi_apache2.c,v 1.105 2003/02/24 15:10:36 zeev Exp $ */
+/* $Id: sapi_apache2.c,v 1.106 2003/03/05 16:12:23 sniper Exp $ */
 
 #include fcntl.h
 
@@ -52,10 +52,12 @@
 #include ap_mpm.h
 
 #include php_apache.h
- 
-#ifdef NETWARE
-#undef shutdown /* To avoid Winsock confusion */
-#endif
+
+/* UnixWare and Netware define shutdown to _shutdown, which causes problems later
+ * on when using a structure member named shutdown. Since this source
+ * file does not use the system call shutdown, it is safe to #undef it.
+ */
+#undef shutdown
 
 /* A way to specify the location of the php.ini dir in an apache directive */
 char *apache2_php_ini_path_override = NULL;
Index: php4/sapi/apache2handler/sapi_apache2.c
diff -u php4/sapi/apache2handler/sapi_apache2.c:1.3 
php4/sapi/apache2handler/sapi_apache2.c:1.4
--- php4/sapi/apache2handler/sapi_apache2.c:1.3 Fri Feb 21 23:42:34 2003
+++ php4/sapi/apache2handler/sapi_apache2.c Wed Mar  5 11:12:23 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: sapi_apache2.c,v 1.3 2003/02/22 04:42:34 jerenkrantz Exp $ */
+/* $Id: sapi_apache2.c,v 1.4 2003/03/05 16:12:23 sniper Exp $ */
 
 #include fcntl.h
 
@@ -50,11 +50,13 @@
 #include ap_mpm.h
 
 #include php_apache.h
- 
-#ifdef NETWARE
-#undef shutdown /* To avoid Winsock confusion */
-#endif
 
+/* UnixWare and Netware define shutdown to _shutdown, which causes problems later
+ * on when using a structure member named shutdown. Since this source
+ * file does not use the system call shutdown, it is safe to #undef it.
+ */
+#undef shutdown
+ 
 #define PHP_MAGIC_TYPE application/x-httpd-php
 #define PHP_SOURCE_MAGIC_TYPE application/x-httpd-php-source
 #define PHP_SCRIPT php-script



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



[PHP-CVS] cvs: php4 /sapi/apache2filter sapi_apache2.c

2003-02-10 Thread Moriyoshi Koizumi
moriyoshi   Mon Feb 10 14:12:02 2003 EDT

  Modified files:  
/php4/sapi/apache2filtersapi_apache2.c 
  Log:
  Removed unnecessary code
  
  
Index: php4/sapi/apache2filter/sapi_apache2.c
diff -u php4/sapi/apache2filter/sapi_apache2.c:1.103 
php4/sapi/apache2filter/sapi_apache2.c:1.104
--- php4/sapi/apache2filter/sapi_apache2.c:1.103Tue Jan 28 11:34:21 2003
+++ php4/sapi/apache2filter/sapi_apache2.c  Mon Feb 10 14:12:02 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: sapi_apache2.c,v 1.103 2003/01/28 16:34:21 iliaa Exp $ */
+/* $Id: sapi_apache2.c,v 1.104 2003/02/10 19:12:02 moriyoshi Exp $ */
 
 #include fcntl.h
 
@@ -336,8 +336,6 @@
apr_bucket *b;
const char *str;
apr_size_t n;
-   const char *prev_fetched_str;
-   apr_size_t prev_fetched_str_len;
apr_status_t rv;
TSRMLS_FETCH();
 
@@ -356,35 +354,8 @@
return rv;
}
 
-   prev_fetched_str = NULL;
-   prev_fetched_str_len = -1;
-
for (b = APR_BRIGADE_FIRST(bb); b != APR_BRIGADE_SENTINEL(bb); b = 
APR_BUCKET_NEXT(b)) {
apr_bucket_read(b, str, n, 1);
-
-   /*
-* An intuitive brigade bug detection
-* (http://bugs.php.net/18648)  
-*
-* This has something to do with the issue mentioned in the thread
-* on [EMAIL PROTECTED]:
-*
-* http://marc.theaimsgroup.com/?l=apr-devm=104039770818472w=2
-*/
-   if (APR_BUCKET_IS_HEAP(b)) {
-   if ((str == prev_fetched_str  n == prev_fetched_str_len)) {
-   char *brigade_dump = NULL;
-   apr_bucket *tmp;
-
-   for (tmp = APR_BRIGADE_FIRST(bb); tmp != 
APR_BRIGADE_SENTINEL(bb); tmp = APR_BUCKET_NEXT(tmp)) {
-   brigade_dump = apr_psprintf(f-r-pool, %s[%s 
%x] , (brigade_dump ? brigade_dump: ), tmp-type-name, (int)tmp);
-   }
-
-   ap_log_error(APLOG_MARK, APLOG_WARNING, 0, 0, * BUG * 
You encountered an apr bug. Please contact to [EMAIL PROTECTED] with the following 
information: %s, (brigade_dump ? brigade_dump: (empty)));
-   }
-   prev_fetched_str = str;
-   prev_fetched_str_len = n;
-   }
if (n  0) {
old_index = ctx-post_len;
ctx-post_len += n;



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




[PHP-CVS] cvs: php4 /sapi/apache2filter sapi_apache2.c

2003-01-28 Thread Ilia Alshanetsky
iliaa   Tue Jan 28 11:34:22 2003 EDT

  Modified files:  
/php4/sapi/apache2filtersapi_apache2.c 
  Log:
  Fixed bug #17868 (more then the !--include-- directive used to include
  a PHP file would result in a crash).
  
  
Index: php4/sapi/apache2filter/sapi_apache2.c
diff -u php4/sapi/apache2filter/sapi_apache2.c:1.102 
php4/sapi/apache2filter/sapi_apache2.c:1.103
--- php4/sapi/apache2filter/sapi_apache2.c:1.102Fri Jan  3 10:59:02 2003
+++ php4/sapi/apache2filter/sapi_apache2.c  Tue Jan 28 11:34:21 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: sapi_apache2.c,v 1.102 2003/01/03 15:59:02 hyanantha Exp $ */
+/* $Id: sapi_apache2.c,v 1.103 2003/01/28 16:34:21 iliaa Exp $ */
 
 #include fcntl.h
 
@@ -532,7 +532,9 @@

php_apache_request_dtor(f TSRMLS_CC);

-   ctx-request_processed = 1;
+   if (!f-r-main) {
+   ctx-request_processed = 1;
+   }
 
/* Delete the FILE bucket from the brigade. */
apr_bucket_delete(b);



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




[PHP-CVS] cvs: php4 /sapi/apache2filter sapi_apache2.c

2002-12-30 Thread Ilia Alshanetsky
iliaa   Mon Dec 30 18:45:19 2002 EDT

  Modified files:  
/php4/sapi/apache2filtersapi_apache2.c 
  Log:
  Fixed bug #21045 (Apache 2 SAPI now supports the mod_php_memory_usage 
  log variable that allows users to log the memory usage of their PHP scripts).
  
  
Index: php4/sapi/apache2filter/sapi_apache2.c
diff -u php4/sapi/apache2filter/sapi_apache2.c:1.98 
php4/sapi/apache2filter/sapi_apache2.c:1.99
--- php4/sapi/apache2filter/sapi_apache2.c:1.98 Fri Dec 27 14:59:09 2002
+++ php4/sapi/apache2filter/sapi_apache2.c  Mon Dec 30 18:45:18 2002
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: sapi_apache2.c,v 1.98 2002/12/27 19:59:09 iliaa Exp $ */
+/* $Id: sapi_apache2.c,v 1.99 2002/12/30 23:45:18 iliaa Exp $ */
 
 #include fcntl.h
 
@@ -498,6 +498,15 @@
zfd.opened_path = NULL;
 
php_execute_script(zfd TSRMLS_CC);
+#ifdef MEMORY_LIMIT
+   {
+   char *mem_usage;
+ 
+   mem_usage = apr_psprintf(ctx-r-pool, %u, 
+AG(allocated_memory_peak));
+   AG(allocated_memory_peak) = 0;
+   apr_table_set(ctx-r-notes, 
+mod_php_memory_usage, mem_usage);
+   }
+#endif
} else { 
zend_syntax_highlighter_ini syntax_highlighter_ini;




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




[PHP-CVS] cvs: php4 /sapi/apache2filter sapi_apache2.c

2002-12-21 Thread Moriyoshi Koizumi
moriyoshi   Sat Dec 21 16:50:29 2002 EDT

  Modified files:  
/php4/sapi/apache2filtersapi_apache2.c 
  Log:
  Made auth information inaccessible under safe mode as discussed in the list
  
  
Index: php4/sapi/apache2filter/sapi_apache2.c
diff -u php4/sapi/apache2filter/sapi_apache2.c:1.96 
php4/sapi/apache2filter/sapi_apache2.c:1.97
--- php4/sapi/apache2filter/sapi_apache2.c:1.96 Sat Dec 21 01:34:31 2002
+++ php4/sapi/apache2filter/sapi_apache2.c  Sat Dec 21 16:50:28 2002
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: sapi_apache2.c,v 1.96 2002/12/21 06:34:31 moriyoshi Exp $ */
+/* $Id: sapi_apache2.c,v 1.97 2002/12/21 21:50:28 moriyoshi Exp $ */
 
 #include fcntl.h
 
@@ -340,7 +340,7 @@
 * An intuitive brigade bug detection
 * (http://bugs.php.net/18648)  
 *
-* This has something to do with the issue mentioned in this thread
+* This has something to do with the issue mentioned in the thread
 * on [EMAIL PROTECTED]:
 *
 * http://marc.theaimsgroup.com/?l=apr-devm=104039770818472w=2
@@ -373,7 +373,7 @@
 {
char *content_type;
const char *auth;
-   
+
PG(during_request_startup) = 0;
SG(sapi_headers).http_response_code = 200;
SG(request_info).content_type = apr_table_get(f-r-headers_in, 
Content-Type);
@@ -387,15 +387,20 @@
f-r-content_type = apr_pstrdup(f-r-pool, content_type);
SG(request_info).post_data = ctx-post_data;
SG(request_info).post_data_length = ctx-post_len;
+
efree(content_type);
apr_table_unset(f-r-headers_out, Content-Length);
apr_table_unset(f-r-headers_out, Last-Modified);
apr_table_unset(f-r-headers_out, Expires);
apr_table_unset(f-r-headers_out, ETag);
apr_table_unset(f-r-headers_in, Connection);
-   auth = apr_table_get(f-r-headers_in, Authorization);
-   php_handle_auth_data(auth TSRMLS_CC);
-
+   if (!PG(safe_mode)) {
+   auth = apr_table_get(f-r-headers_in, Authorization);
+   php_handle_auth_data(auth TSRMLS_CC);
+   } else {
+   SG(request_info).auth_user = NULL;
+   SG(request_info).auth_password = NULL;
+   }
php_request_startup(TSRMLS_C);
 }
 



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




[PHP-CVS] cvs: php4 /sapi/apache2filter sapi_apache2.c

2002-12-20 Thread Moriyoshi Koizumi
moriyoshi   Sat Dec 21 01:34:31 2002 EDT

  Modified files:  
/php4/sapi/apache2filtersapi_apache2.c 
  Log:
  WS
  
  
Index: php4/sapi/apache2filter/sapi_apache2.c
diff -u php4/sapi/apache2filter/sapi_apache2.c:1.95 
php4/sapi/apache2filter/sapi_apache2.c:1.96
--- php4/sapi/apache2filter/sapi_apache2.c:1.95 Sat Dec 21 01:33:19 2002
+++ php4/sapi/apache2filter/sapi_apache2.c  Sat Dec 21 01:34:31 2002
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: sapi_apache2.c,v 1.95 2002/12/21 06:33:19 moriyoshi Exp $ */
+/* $Id: sapi_apache2.c,v 1.96 2002/12/21 06:34:31 moriyoshi Exp $ */
 
 #include fcntl.h
 
@@ -337,14 +337,14 @@
apr_bucket_read(b, str, n, 1);
 
/*
- * An intuitive brigade bug detection
+* An intuitive brigade bug detection
 * (http://bugs.php.net/18648)  
 *
- * This has something to do with the issue mentioned in this thread
- * on [EMAIL PROTECTED]:
+* This has something to do with the issue mentioned in this thread
+* on [EMAIL PROTECTED]:
 *
- * http://marc.theaimsgroup.com/?l=apr-devm=104039770818472w=2
- */
+* http://marc.theaimsgroup.com/?l=apr-devm=104039770818472w=2
+*/
if (APR_BUCKET_IS_HEAP(b)) {
if ((str == prev_fetched_str  n == prev_fetched_str_len)) {
char *brigade_dump = NULL;



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




[PHP-CVS] cvs: php4 /sapi/apache2filter sapi_apache2.c

2002-12-18 Thread Moriyoshi Koizumi
moriyoshi   Wed Dec 18 14:32:44 2002 EDT

  Modified files:  
/php4/sapi/apache2filtersapi_apache2.c 
  Log:
  An intuitive attempt to hunt the bug.
  
  
Index: php4/sapi/apache2filter/sapi_apache2.c
diff -u php4/sapi/apache2filter/sapi_apache2.c:1.93 
php4/sapi/apache2filter/sapi_apache2.c:1.94
--- php4/sapi/apache2filter/sapi_apache2.c:1.93 Mon Dec  9 13:45:32 2002
+++ php4/sapi/apache2filter/sapi_apache2.c  Wed Dec 18 14:32:44 2002
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: sapi_apache2.c,v 1.93 2002/12/09 18:45:32 iliaa Exp $ */
+/* $Id: sapi_apache2.c,v 1.94 2002/12/18 19:32:44 moriyoshi Exp $ */
 
 #include fcntl.h
 
@@ -310,6 +310,8 @@
apr_bucket *b;
const char *str;
apr_size_t n;
+   const char *prev_fetched_str;
+   apr_size_t prev_fetched_str_len;
apr_status_t rv;
TSRMLS_FETCH();
 
@@ -328,8 +330,25 @@
return rv;
}
 
+   prev_fetched_str = NULL;
+   prev_fetched_str_len = -1;
+
for (b = APR_BRIGADE_FIRST(bb); b != APR_BRIGADE_SENTINEL(bb); b = 
APR_BUCKET_NEXT(b)) {
apr_bucket_read(b, str, n, 1);
+   if (APR_BUCKET_IS_HEAP(b)) {
+   if ((str == prev_fetched_str  n == prev_fetched_str_len)) {
+   char *brigade_dump = NULL;
+   apr_bucket *tmp;
+
+   for (tmp = APR_BRIGADE_FIRST(bb); tmp != 
+APR_BRIGADE_SENTINEL(bb); tmp = APR_BUCKET_NEXT(tmp)) {
+   brigade_dump = apr_psprintf(f-r-pool, %s[%s 
+%x] , (brigade_dump ? brigade_dump: ), tmp-type-name, (int)tmp);
+   }
+
+   ap_log_error(APLOG_MARK, APLOG_WARNING, 0, 0, * BUG * 
+You encountered an apr bug. Please contact to [EMAIL PROTECTED] with the 
+following information: %s, (brigade_dump ? brigade_dump: (empty)));
+   }
+   prev_fetched_str = str;
+   prev_fetched_str_len = n;
+   }
if (n  0) {
old_index = ctx-post_len;
ctx-post_len += n;



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




[PHP-CVS] cvs: php4 /sapi/apache2filter sapi_apache2.c

2002-12-09 Thread Ilia Alshanetsky
iliaa   Mon Dec  9 13:45:32 2002 EDT

  Modified files:  
/php4/sapi/apache2filtersapi_apache2.c 
  Log:
  Replaced deprecated APR_BRIGADE_FOREACH macro.
  
  
Index: php4/sapi/apache2filter/sapi_apache2.c
diff -u php4/sapi/apache2filter/sapi_apache2.c:1.92 
php4/sapi/apache2filter/sapi_apache2.c:1.93
--- php4/sapi/apache2filter/sapi_apache2.c:1.92 Tue Nov 26 00:57:02 2002
+++ php4/sapi/apache2filter/sapi_apache2.c  Mon Dec  9 13:45:32 2002
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: sapi_apache2.c,v 1.92 2002/11/26 05:57:02 sniper Exp $ */
+/* $Id: sapi_apache2.c,v 1.93 2002/12/09 18:45:32 iliaa Exp $ */
 
 #include fcntl.h
 
@@ -328,7 +328,7 @@
return rv;
}
 
-   APR_BRIGADE_FOREACH(b, bb) {
+   for (b = APR_BRIGADE_FIRST(bb); b != APR_BRIGADE_SENTINEL(bb); b = 
+APR_BUCKET_NEXT(b)) {
apr_bucket_read(b, str, n, 1);
if (n  0) {
old_index = ctx-post_len;
@@ -415,7 +415,7 @@
return ap_pass_brigade(f-next, bb);
}
 
-   APR_BRIGADE_FOREACH(b, bb) {
+   for (b = APR_BRIGADE_FIRST(bb); b != APR_BRIGADE_SENTINEL(bb); b = 
+APR_BUCKET_NEXT(b)) {
zend_file_handle zfd;
 
if (!ctx-request_processed  APR_BUCKET_IS_FILE(b)) {



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




[PHP-CVS] cvs: php4 /sapi/apache2filter sapi_apache2.c

2002-11-01 Thread Sascha Schumann
sas Fri Nov  1 23:35:25 2002 EDT

  Modified files:  
/php4/sapi/apache2filtersapi_apache2.c 
  Log:
  fix obvious copypaste error
  
  
Index: php4/sapi/apache2filter/sapi_apache2.c
diff -u php4/sapi/apache2filter/sapi_apache2.c:1.89 
php4/sapi/apache2filter/sapi_apache2.c:1.90
--- php4/sapi/apache2filter/sapi_apache2.c:1.89 Tue Oct 22 08:20:12 2002
+++ php4/sapi/apache2filter/sapi_apache2.c  Fri Nov  1 23:35:25 2002
 -380,7 +380,7 
if (SG(request_info).query_string) {
free(SG(request_info).query_string);
}
-   if (SG(request_info).query_string) {
+   if (SG(request_info).request_uri) {
free(SG(request_info).request_uri);
}
 }



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




[PHP-CVS] cvs: php4 /sapi/apache2filter sapi_apache2.c

2002-10-04 Thread Ilia Alshanetsky

iliaa   Fri Oct  4 17:16:00 2002 EDT

  Modified files:  
/php4/sapi/apache2filtersapi_apache2.c 
  Log:
  Added .phps support to Apache 2. It can be enabled by adding
  AddType application/x-httpd-php-source .phps 
  to httpd.conf
  
  
Index: php4/sapi/apache2filter/sapi_apache2.c
diff -u php4/sapi/apache2filter/sapi_apache2.c:1.85 
php4/sapi/apache2filter/sapi_apache2.c:1.86
--- php4/sapi/apache2filter/sapi_apache2.c:1.85 Mon Sep 23 14:51:34 2002
+++ php4/sapi/apache2filter/sapi_apache2.c  Fri Oct  4 17:15:59 2002
 -27,6 +27,7 
 #include SAPI.h
 
 #include ext/standard/php_smart_str.h
+#include ext/standard/php_standard.h
 
 #include apr_strings.h
 #include ap_config.h
 -440,12 +441,23 
php_apache_request_ctor(f, ctx TSRMLS_CC);
 
apr_file_name_get(path, ((apr_bucket_file *) b-data)-fd);
-   zfd.type = ZEND_HANDLE_FILENAME;
-   zfd.filename = (char *) path;
-   zfd.free_filename = 0;
-   zfd.opened_path = NULL;
-
-   php_execute_script(zfd TSRMLS_CC);
+   
+   /* Determine if we need to parse the file or show the source */
+   if (!strncmp(ctx-r-handler, application/x-httpd-php, 
+sizeof(application/x-httpd-php))) { 
+   zfd.type = ZEND_HANDLE_FILENAME;
+   zfd.filename = (char *) path;
+   zfd.free_filename = 0;
+   zfd.opened_path = NULL;
+
+   php_execute_script(zfd TSRMLS_CC);
+   } else { 
+   zend_syntax_highlighter_ini syntax_highlighter_ini;
+   
+   php_get_highlight_struct(syntax_highlighter_ini);
+   
+   highlight_file((char *)path, syntax_highlighter_ini 
+TSRMLS_CC);
+   }   
+   
php_apache_request_dtor(f TSRMLS_CC);

ctx-request_processed = 1;
 -560,10 +572,13 
 
 static void php_insert_filter(request_rec *r)
 {
-   if (r-content_type 
-   strcmp(r-content_type, application/x-httpd-php) == 0) {
-   php_add_filter(r, r-output_filters);
-   php_add_filter(r, r-input_filters);
+   int content_type_len = strlen(application/x-httpd-php);
+
+   if (r-content_type  !strncmp(r-content_type, application/x-httpd-php, 
+content_type_len-1)) {
+   if (r-content_type[content_type_len] == '\0' || 
+!strncmp(r-content_type+content_type_len, -source, strlen(-source))) { 
+   php_add_filter(r, r-output_filters);
+   php_add_filter(r, r-input_filters);
+   }   
}
 }
 



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