Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add php_handle_aborted_connection()

Call this from your SAPI module to signal an aborted connection.
  • Loading branch information...
commit 13183ed5c3d18abc8a352defdd3f567125fe5bb9 1 parent c38005a
Sascha Schumann authored

Showing 2 changed files with 12 additions and 0 deletions. Show diff stats Hide diff stats

  1. +11 0 main/main.c
  2. +1 0  main/php_main.h
11 main/main.c
@@ -1214,6 +1214,17 @@ PHPAPI void php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_
1214 1214 free_alloca(old_cwd);
1215 1215 }
1216 1216
  1217 +PHPAPI void php_handle_aborted_connection(void)
  1218 +{
  1219 + PLS_FETCH();
  1220 +
  1221 + PG(connection_status) = PHP_CONNECTION_ABORTED;
  1222 +
  1223 + if (!PG(ignore_user_abort)) {
  1224 + zend_bailout();
  1225 + }
  1226 +}
  1227 +
1217 1228 PHPAPI int php_handle_auth_data(const char *auth SLS_DC)
1218 1229 {
1219 1230 int ret = -1;
1  main/php_main.h
@@ -44,6 +44,7 @@ PHPAPI void php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_
44 44 PHPAPI int php_handle_special_queries(SLS_D PLS_DC);
45 45 PHPAPI int php_lint_script(zend_file_handle *file CLS_DC ELS_DC PLS_DC);
46 46
  47 +PHPAPI void php_handle_aborted_connection(void);
47 48 PHPAPI int php_handle_auth_data(const char *auth SLS_DC);
48 49
49 50 extern void php_call_shutdown_functions(void);

0 comments on commit 13183ed

Please sign in to comment.
Something went wrong with that request. Please try again.