CVS update: php3
| From: | shane | Date: | Sat, 30 Jan 1999 00:52:21 +0000 |
| Subject: | CVS update: php3 | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-3788@lists.php.net to get a copy of this message | ||
Date: Friday January 29, 1999 @ 19:52
Author: shane
Update of /repository/php3
In directory asf:/u/temp/cvs-serv11011
Modified Files:
fopen-wrappers.h main.c php.h php3.dsp
Log Message:
some work on this abort stuff. I don't beleive that you can test for failures against stdout
for cgi's. At least in my implementation, the script continues past my user abort. The user
function for timeout is working now though, which is nice.
fixed some warnings in iptc
Index: php3/fopen-wrappers.h
diff -c php3/fopen-wrappers.h:1.21 php3/fopen-wrappers.h:1.22
*** php3/fopen-wrappers.h:1.21 Fri Jan 1 12:58:49 1999
--- php3/fopen-wrappers.h Fri Jan 29 19:52:20 1999
***************
*** 26,32 ****
| Authors: Jim Winstead <jimw@php.net> |
+----------------------------------------------------------------------+
*/
! /* $Id: fopen-wrappers.h,v 1.21 1999/01/01 17:58:49 zeev Exp $ */
#ifndef _FOPEN_WRAPPERS_H
#define _FOPEN_WRAPPERS_H
--- 26,32 ----
| Authors: Jim Winstead <jimw@php.net> |
+----------------------------------------------------------------------+
*/
! /* $Id: fopen-wrappers.h,v 1.22 1999/01/30 00:52:20 shane Exp $ */
#ifndef _FOPEN_WRAPPERS_H
#define _FOPEN_WRAPPERS_H
***************
*** 77,83 ****
extern PHPAPI int php3_isurl(char *path);
extern PHPAPI char *php3_strip_url_passwd(char *path);
- extern PHPAPI int php3_write(void *buf, int size);
extern PHPAPI char *expand_filepath(char *filepath);
--- 77,82 ----
Index: php3/main.c
diff -c php3/main.c:1.494 php3/main.c:1.495
*** php3/main.c:1.494 Thu Jan 28 21:39:50 1999
--- php3/main.c Fri Jan 29 19:52:20 1999
***************
*** 29,35 ****
+----------------------------------------------------------------------+
*/
! /* $Id: main.c,v 1.494 1999/01/29 02:39:50 rasmus Exp $ */
/* #define CRASH_DETECTION */
--- 29,35 ----
+----------------------------------------------------------------------+
*/
! /* $Id: main.c,v 1.495 1999/01/30 00:52:20 shane Exp $ */
/* #define CRASH_DETECTION */
***************
*** 171,183 ****
}
! #if APACHE
! int php3_apache_write(const void *a, int n)
{
int ret;
TLS_VARS;
ret = rwrite(a,n,GLOBAL(php3_rqst));
if (ret != n) {
GLOBAL(php_connection_status) |= PHP_CONNECTION_ABORTED;
--- 171,186 ----
}
! PHPAPI int php3_write(const void *a, int n)
{
int ret;
TLS_VARS;
+ #if APACHE
ret = rwrite(a,n,GLOBAL(php3_rqst));
+ #else /* CGI */
+ ret = fwrite(a,1,n,stdout);
+ #endif
if (ret != n) {
GLOBAL(php_connection_status) |= PHP_CONNECTION_ABORTED;
***************
*** 186,195 ****
return ret;
}
! void php3_apache_puts(const char *s)
{
TLS_VARS;
if (GLOBAL(php3_rqst)) {
if (rputs(s, GLOBAL(php3_rqst)) == -1) {
GLOBAL(php_connection_status) |= PHP_CONNECTION_ABORTED;
--- 189,199 ----
return ret;
}
! PHPAPI void php3_puts(const char *s)
{
TLS_VARS;
+ #if APACHE
if (GLOBAL(php3_rqst)) {
if (rputs(s, GLOBAL(php3_rqst)) == -1) {
GLOBAL(php_connection_status) |= PHP_CONNECTION_ABORTED;
***************
*** 197,208 ****
} else {
fputs(s, stdout);
}
}
! void php3_apache_putc(char c)
{
TLS_VARS;
if (GLOBAL(php3_rqst)) {
if (rputc(c, GLOBAL(php3_rqst)) != c) {
GLOBAL(php_connection_status) |= PHP_CONNECTION_ABORTED;
--- 201,218 ----
} else {
fputs(s, stdout);
}
+ #else /* CGI */
+ if (fputs(s, stdout) < 0) {
+ GLOBAL(php_connection_status) |= PHP_CONNECTION_ABORTED;
+ }
+ #endif
}
! PHPAPI void php3_putc(char c)
{
TLS_VARS;
+ #if APACHE
if (GLOBAL(php3_rqst)) {
if (rputc(c, GLOBAL(php3_rqst)) != c) {
GLOBAL(php_connection_status) |= PHP_CONNECTION_ABORTED;
***************
*** 210,217 ****
} else {
fputc(c, stdout);
}
! }
#endif
void php3_log_err(char *log_message)
{
--- 220,231 ----
} else {
fputc(c, stdout);
}
! #else
! if (fputc(c, stdout) != c) {
! GLOBAL(php_connection_status) |= PHP_CONNECTION_ABORTED;
! }
#endif
+ }
void php3_log_err(char *log_message)
{
***************
*** 268,280 ****
/* is 4K big enough? */
#define PRINTF_BUFFER_SIZE 1024*4
- /* wrapper for modules to use PHPWRITE */
- PHPAPI int php3_write(void *buf, int size)
- {
- TLS_VARS;
- return PHPWRITE(buf, size);
- }
-
PHPAPI int php3_printf(const char *format,...)
{
va_list args;
--- 282,287 ----
***************
*** 428,446 ****
{
Token *token;
#if (WIN32|WINNT)
! if (GLOBAL(wintimer) && !(++GLOBAL(wintimer_counter) & 0xff) &&
(GLOBAL(wintimer) < (unsigned int) clock())) {
! php3_error(E_WARNING, "PHP Timed out!<br>\n");
GLOBAL(shutdown_requested) = ABNORMAL_SHUTDOWN;
}
#endif
!
if (!GLOBAL(initialized) || GLOBAL(shutdown_requested)) {
if (GLOBAL(shutdown_requested)==TERMINATE_CURRENT_PHPPARSE) {
GLOBAL(shutdown_requested)=0;
}
return 0;
}
#if APACHE
if ((php3_rqst->connection->aborted ||
GLOBAL(php_connection_status)&PHP_CONNECTION_ABORTED)
&& !GLOBAL(ignore_user_abort)) {
--- 435,459 ----
{
Token *token;
+ /* this is timing for windows */
#if (WIN32|WINNT)
! if (GLOBAL(wintimer) && !(++GLOBAL(wintimer_counter) & 0xff)
! && (GLOBAL(wintimer) < (unsigned int) clock())) {
! php3_error(E_NOTICE, "PHP Timed out!<br>\n");
GLOBAL(shutdown_requested) = ABNORMAL_SHUTDOWN;
+ GLOBAL(php_connection_status) |= PHP_CONNECTION_TIMEOUT;
+ /*GLOBAL(ignore_user_abort) = 1;*/
}
#endif
!
if (!GLOBAL(initialized) || GLOBAL(shutdown_requested)) {
if (GLOBAL(shutdown_requested)==TERMINATE_CURRENT_PHPPARSE) {
GLOBAL(shutdown_requested)=0;
}
return 0;
}
+
+
#if APACHE
if ((php3_rqst->connection->aborted ||
GLOBAL(php_connection_status)&PHP_CONNECTION_ABORTED)
&& !GLOBAL(ignore_user_abort)) {
***************
*** 454,459 ****
--- 467,480 ----
GLOBAL(ignore_user_abort) = 1;
return 0;
}
+ #else /* CGI */
+ #if CGI_CHECK_ABORT
+ if ((GLOBAL(php_connection_status)&PHP_CONNECTION_ABORTED) &&
!GLOBAL(ignore_user_abort)) {
+ GLOBAL(shutdown_requested) = ABNORMAL_SHUTDOWN;
+ GLOBAL(ignore_user_abort) = 1;
+ return 0;
+ }
+ #endif
#endif
#ifdef THREAD_SAFE
Index: php3/php.h
diff -c php3/php.h:1.46 php3/php.h:1.47
*** php3/php.h:1.46 Fri Jan 29 16:42:14 1999
--- php3/php.h Fri Jan 29 19:52:20 1999
***************
*** 28,34 ****
+----------------------------------------------------------------------+
*/
! /* $Id: php.h,v 1.46 1999/01/29 21:42:14 shane Exp $ */
#ifndef _PHP_H
#define _PHP_H
--- 28,34 ----
+----------------------------------------------------------------------+
*/
! /* $Id: php.h,v 1.47 1999/01/30 00:52:20 shane Exp $ */
#ifndef _PHP_H
#define _PHP_H
***************
*** 246,260 ****
#define EXEC_INPUT_BUF 4096
#if APACHE
! extern PHPAPI void php3_apache_puts(const char *s);
! extern PHPAPI void php3_apache_putc(char c);
! extern PHPAPI int php3_apache_write(const void *a, int n);
! # if !defined(COMPILE_DL)
! # define PUTS(s) php3_apache_puts(s)
! # define PUTC(c) php3_apache_putc(c)
! # define PHPWRITE(a,n) php3_apache_write(a,n)
/* thies@digicol.de 990119 # define PHPWRITE(a,n) rwrite((a),(n),GLOBAL(php3_rqst)) */
- # endif
#endif
#if FHTTPD
--- 246,258 ----
#define EXEC_INPUT_BUF 4096
#if APACHE
! extern PHPAPI void php3_puts(const char *s);
! extern PHPAPI void php3_putc(char c);
! extern PHPAPI int php3_write(const void *a, int n);
! # define PUTS(s) php3_puts(s)
! # define PUTC(c) php3_putc(c)
! # define PHPWRITE(a,n) php3_write(a,n)
/* thies@digicol.de 990119 # define PHPWRITE(a,n) rwrite((a),(n),GLOBAL(php3_rqst)) */
#endif
#if FHTTPD
***************
*** 288,312 ****
extern PHPAPI void php3_fhttpd_puts(char *s);
extern PHPAPI void php3_fhttpd_putc(char c);
extern PHPAPI int php3_fhttpd_write(char *a,int n);
- # if !defined(COMPILE_DL)
# define PUTS(s) php3_fhttpd_puts(s)
# define PUTC(c) php3_fhttpd_putc(c)
# define PHPWRITE(a,n) php3_fhttpd_write((a),(n))
- # endif
#endif
#if CGI_BINARY
! # if !defined(COMPILE_DL)
! # define PUTS(a) fputs((a),stdout)
! # define PUTC(a) fputc((a),stdout)
! # define PHPWRITE(a,n) fwrite((a),(n),1,stdout)
# endif
- #endif
-
- #if defined(THREAD_SAFE) || defined(COMPILE_DL)
- #define PUTS(a) php3_printf("%s",a)
- #define PUTC(a) PUTS(a)
- #define PHPWRITE(a,n) php3_write((a),(n))
#endif
#define E_ERROR 0x1
--- 286,311 ----
extern PHPAPI void php3_fhttpd_puts(char *s);
extern PHPAPI void php3_fhttpd_putc(char c);
extern PHPAPI int php3_fhttpd_write(char *a,int n);
# define PUTS(s) php3_fhttpd_puts(s)
# define PUTC(c) php3_fhttpd_putc(c)
# define PHPWRITE(a,n) php3_fhttpd_write((a),(n))
#endif
#if CGI_BINARY
! extern PHPAPI void php3_puts(const char *s);
! extern PHPAPI void php3_putc(char c);
! extern PHPAPI int php3_write(const void *a, int n);
! /* to test user abort in a cgi, make CGI_CHECK_ABOUT = 1 */
! #define CGI_CHECK_ABORT 0
! # if CGI_CHECK_ABORT
! # define PUTS(a) php3_puts(a)
! # define PUTC(a) php3_putc(a)
! # define PHPWRITE(a,n) php3_write((a),(n))
! # else
! # define PUTS(a) fputs(a,stdout)
! # define PUTC(a) fputc(a,stdout)
! # define PHPWRITE(a,n) fwrite((a),1,(n),stdout)
# endif
#endif
#define E_ERROR 0x1
Index: php3/php3.dsp
diff -c php3/php3.dsp:1.50 php3/php3.dsp:1.51
*** php3/php3.dsp:1.50 Fri Jan 29 16:42:14 1999
--- php3/php3.dsp Fri Jan 29 19:52:20 1999
***************
*** 67,73 ****
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D
"_CONSOLE" /D "_MBCS" /YX /FD /c
! # ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "." /I "regex\\" /I
"d:\src\bind\include" /I "d:/src/wc5sdk/server/include/cpp" /D "DEBUG"
/D "_DEBUG" /D "MSVC5" /D "WIN32" /D "_CONSOLE" /D
"_MBCS" /FR /YX /FD /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /i "c:\include" /d "_DEBUG"
BSC32=bscmake.exe
--- 67,73 ----
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D
"_CONSOLE" /D "_MBCS" /YX /FD /c
! # ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "." /I "regex\\" /I
"d:\src\bind\include" /I "d:/src/wc5sdk/server/include/cpp" /D DEBUG=1 /D
"_DEBUG" /D "MSVC5" /D "WIN32" /D "_CONSOLE" /D
"_MBCS" /FR /YX /FD /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /i "c:\include" /d "_DEBUG"
BSC32=bscmake.exe
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net