CVS update: php3/functions
| From: | rasmus | Date: | Wed, 27 Jan 1999 19:18:13 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-3745@lists.php.net to get a copy of this message | ||
Date: Wednesday January 27, 1999 @ 14:18
Author: rasmus
Update of /repository/php3/functions
In directory asf:/u/temp/cvs-serv8695/functions
Modified Files:
basic_functions.c basic_functions.h php3_mckcrypt.c
php3_mckcrypt.h
Log Message:
Heads up! The following completely cleans up the aborted connection
mess that never worked reliably. Thanks to Thies C. Arntzen for getting
me started on this. There was a bit more to it than his initial work.
As discussed with some Apache guys, we are now checking the return status
of each write and set a global connection_aborted variable if the number of
bytes written do not match the number of bytes sent. A user-level
connection_aborted() function has been added. This returns true if the
connection was aborted, obviously. This is useful in a user-level
registered shutdown function if something needs to be cleaned up
differently if the remote user hit his stop button.
Index: php3/functions/basic_functions.c
diff -c php3/functions/basic_functions.c:1.253 php3/functions/basic_functions.c:1.254
*** php3/functions/basic_functions.c:1.253 Sun Jan 24 19:02:27 1999
--- php3/functions/basic_functions.c Wed Jan 27 14:18:12 1999
***************
*** 28,34 ****
+----------------------------------------------------------------------+
*/
! /* $Id: basic_functions.c,v 1.253 1999/01/25 00:02:27 sas Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
#endif
--- 28,34 ----
+----------------------------------------------------------------------+
*/
! /* $Id: basic_functions.c,v 1.254 1999/01/27 19:18:12 rasmus Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
#endif
***************
*** 315,320 ****
--- 315,322 ----
PHP_FE(register_shutdown_function, NULL)
+ PHP_FE(connection_aborted, NULL)
+
{NULL, NULL, NULL}
};
***************
*** 500,505 ****
--- 502,516 ----
#endif
/* }}} */
+ /* {{{ proto int connection_aborted()
+ Did we have any write-errors on the output side? */
+ void php3_connection_aborted(INTERNAL_FUNCTION_PARAMETERS)
+ {
+ TLS_VARS;
+
+ RETVAL_LONG(GLOBAL(connection_aborted));
+ }
+
/* {{{ proto int error_reporting([int level])
Set/get the current error reporting level */
void php3_error_reporting(INTERNAL_FUNCTION_PARAMETERS)
***************
*** 1235,1247 ****
#if APACHE
TLS_VARS;
# if MODULE_MAGIC_NUMBER > 19970110
! rflush(GLOBAL(php3_rqst));
# else
! bflush(GLOBAL(php3_rqst)->connection->client);
# endif
#endif
#if FHTTPD
! /*FIXME -- what does it flush really? the whole response?*/
#endif
#if CGI_BINARY
fflush(stdout);
--- 1246,1262 ----
#if APACHE
TLS_VARS;
# if MODULE_MAGIC_NUMBER > 19970110
! if (rflush(GLOBAL(php3_rqst)) == -1)
! GLOBAL(connection_aborted) = 1;
# else
! if (bflush(GLOBAL(php3_rqst)->connection->client) == -1)
! GLOBAL(connection_aborted) = 1;
# endif
#endif
#if FHTTPD
! /*FIXME -- what does it flush really? the whole response?
! It flushes whatever has been sent to Apache so far -RL
! */
#endif
#if CGI_BINARY
fflush(stdout);
Index: php3/functions/basic_functions.h
diff -c php3/functions/basic_functions.h:1.36 php3/functions/basic_functions.h:1.37
*** php3/functions/basic_functions.h:1.36 Fri Jan 1 12:59:07 1999
--- php3/functions/basic_functions.h Wed Jan 27 14:18:13 1999
***************
*** 29,35 ****
*/
! /* $Id: basic_functions.h,v 1.36 1999/01/01 17:59:07 zeev Exp $ */
#ifndef _BASIC_FUNCTIONS_H
#define _BASIC_FUNCTIONS_H
--- 29,35 ----
*/
! /* $Id: basic_functions.h,v 1.37 1999/01/27 19:18:13 rasmus Exp $ */
#ifndef _BASIC_FUNCTIONS_H
#define _BASIC_FUNCTIONS_H
***************
*** 95,100 ****
--- 95,101 ----
extern void php3_call_user_func(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_call_user_method(INTERNAL_FUNCTION_PARAMETERS);
+ extern void php3_connection_aborted(INTERNAL_FUNCTION_PARAMETERS);
PHP_FUNCTION(register_shutdown_function);
Index: php3/functions/php3_mckcrypt.c
diff -c php3/functions/php3_mckcrypt.c:1.1 php3/functions/php3_mckcrypt.c:1.2
*** php3/functions/php3_mckcrypt.c:1.1 Tue Jan 26 17:25:13 1999
--- php3/functions/php3_mckcrypt.c Wed Jan 27 14:18:13 1999
***************
*** 39,47 ****
#include "php.h"
#include "internal_functions.h"
- #include "mckcrypt.h"
#include "php3_mckcrypt.h"
function_entry mckcrypt_functions[] = {
{"mck_encr",php3_mckencr,NULL},
{"mck_decr",php3_mckdecr,NULL},
--- 39,50 ----
#include "php.h"
#include "internal_functions.h"
#include "php3_mckcrypt.h"
+ #if HAVE_MCK
+
+ #include "mckcrypt.h"
+
function_entry mckcrypt_functions[] = {
{"mck_encr",php3_mckencr,NULL},
{"mck_decr",php3_mckdecr,NULL},
***************
*** 222,224 ****
--- 225,228 ----
return_value->type=IS_STRING;
}
+ #endif
Index: php3/functions/php3_mckcrypt.h
diff -c php3/functions/php3_mckcrypt.h:1.1 php3/functions/php3_mckcrypt.h:1.2
*** php3/functions/php3_mckcrypt.h:1.1 Tue Jan 26 17:25:13 1999
--- php3/functions/php3_mckcrypt.h Wed Jan 27 14:18:13 1999
***************
*** 32,38 ****
/* MCKCRYPT.H - header file for MCKCRYPT.C
*/
! #ifdef HAVE_MCK
extern php3_module_entry mckcrypt_module_entry;
#define mckcrypt_module_ptr &mckcrypt_module_entry
--- 32,38 ----
/* MCKCRYPT.H - header file for MCKCRYPT.C
*/
! #if HAVE_MCK
extern php3_module_entry mckcrypt_module_entry;
#define mckcrypt_module_ptr &mckcrypt_module_entry
***************
*** 42,48 ****
extern void php3_mckbase64_decode(INTERNAL_FUNCTION_PARAMETERS);
#else
! #define mckcrypt_module_ptr NULL;
#endif
--- 42,48 ----
extern void php3_mckbase64_decode(INTERNAL_FUNCTION_PARAMETERS);
#else
! #define mckcrypt_module_ptr NULL
#endif
--
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