From 13183ed5c3d18abc8a352defdd3f567125fe5bb9 Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Sun, 29 Oct 2000 16:00:42 +0000 Subject: [PATCH] Add php_handle_aborted_connection() Call this from your SAPI module to signal an aborted connection. --- main/main.c | 11 +++++++++++ main/php_main.h | 1 + 2 files changed, 12 insertions(+) diff --git a/main/main.c b/main/main.c index 90e41c3f3df..e7bf7a4519c 100644 --- a/main/main.c +++ b/main/main.c @@ -1214,6 +1214,17 @@ PHPAPI void php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_ free_alloca(old_cwd); } +PHPAPI void php_handle_aborted_connection(void) +{ + PLS_FETCH(); + + PG(connection_status) = PHP_CONNECTION_ABORTED; + + if (!PG(ignore_user_abort)) { + zend_bailout(); + } +} + PHPAPI int php_handle_auth_data(const char *auth SLS_DC) { int ret = -1; diff --git a/main/php_main.h b/main/php_main.h index 390002d3197..22b1bbc8c49 100644 --- a/main/php_main.h +++ b/main/php_main.h @@ -44,6 +44,7 @@ PHPAPI void php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_ PHPAPI int php_handle_special_queries(SLS_D PLS_DC); PHPAPI int php_lint_script(zend_file_handle *file CLS_DC ELS_DC PLS_DC); +PHPAPI void php_handle_aborted_connection(void); PHPAPI int php_handle_auth_data(const char *auth SLS_DC); extern void php_call_shutdown_functions(void);